-
Notifications
You must be signed in to change notification settings - Fork 15
Support Partitioning #34
Comments
Dynamic JSON property name for the partition key could be supported via a custom ContractResolver: |
Could you provide an example configuration?
Can I use userName as Partition key? "AspNetCore.Identity.DocumentDB" Version="2.0.0-beta4" |
The configuration looks fine. beta4 broke compatibility with older data sets. But in case you need them I can send you some instructions how to migrate them. |
At the moment the partition key has to be set to |
@felschr Can you post what to do if we need to migrate from pre-beta4? |
This commit essentially contains those breaking changes: 4930fc6 If you want to migrate your data you'd have to replace all documents with The layout of those two new documents is basically the same as before: {
"partition": "[email protected]", // email address here
"id": "userMappingEmail",
"type": "userMappingEmail",
"targetId": "f6d8c5f6-1b0a-4eec-bea5-c64dba0f44fd"
} {
"partition": "[email protected]", // username here (in this case it's the same as email address)
"id": "userMappingUsername",
"type": "userMappingUsername",
"targetId": "f6d8c5f6-1b0a-4eec-bea5-c64dba0f44fd"
} |
Hmm. What if I was not using partitioning before and I need to add it to an existing collection of users created in beta2 without partition key set? I'm switching to using shared RU's on my database which requires a partition key to be set for each collection, but it seems like you add extra documents for the partitions (or I'm missing something). |
Ok, I figured out how to do it by exporting the documents to json and using Sublime Text find & replace regex to add the new partition documents. I'm going to put the steps here in case anyone else might find them useful. Note that this is only useful if adding partitioning later.
Hope this helps someone. |
Support Cosmos DB partitioning.
There is a beta release right now with basic functionality.
There are a few drawbacks, though:
The text was updated successfully, but these errors were encountered: