-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Cosmos DB Partitioned following feedback #2684
Conversation
garypretty
commented
Oct 9, 2019
- Amends container creation to disable indexing
- Switch to using ReadItemAsync instead of Query
- Switch PartitionKey to use Id instead of RealId
Use Id for partition key. Use ReadItemAsync instead of Query.
Removed redundant Throughput option - we will create container with default settings and allow user to amend in Azure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cosmos specific logic looks good. 👍
FYI - it looks like you also stopped passing a throughput, so you'll get whatever the SDK thinks the default ought to be. That's probably fine, but you didn't mention it in your change notes, so wanted to call it out as it is potentially a behavioral change.
Thanks @christopheranderson - I couldn't see a way of specifying the throughput when defining my container. I don't believe this is an issue anyway as the user can manage afterwards in Azure if needed and I will ensure it is added to the sample comments as well. Cheers again! |
_cosmosDbStorageOptions.ContainerThroughput) | ||
.DefineContainer(_cosmosDbStorageOptions.ContainerId, DocumentStoreItem.PartitionKeyPath) | ||
.WithIndexingPolicy().WithAutomaticIndexing(false).WithIndexingMode(IndexingMode.None).Attach() | ||
.CreateIfNotExistsAsync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.CreateIfNotExistsAsync() | |
.CreateIfNotExistsAsync(_cosmosDbStorageOptions.ContainerThroughput) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@j82w Ah! Thank you! I will update.
@gary Should the tests include not throwing when deleting non-existing item? I'm not sure if it throws a 404 on the dotnet side, but I know it does in Node. |
@mdrichardson ill check. Good shout I think. I'll add a test. We have a read unknown so we should probably have a delete unknown test too. |
Pull Request Test Coverage Report for Build 82595
💛 - Coveralls |
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.5.3 |