-
Notifications
You must be signed in to change notification settings - Fork 93
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
Missing partition key on header #75
Comments
It looks like this change in the portal: ...is causing all collections created via the portal to require a partition key. Currently this SDK has no method of passing a partition key in the header, leading to the error. This SDK will be updated to allow for the partition key. In the meantime, a workaround is to create the collection programmatically via the SDK, which does not require a partition key to be set. |
thanks for confirming this @NateRickard looking forward to the update |
hi @NateRickard just tested this and I'm still seeing same error. i checked i had updated to 0.2.0 perhaps i missed something else. here's the details: the database
update worked fine/build ok. doc class:
test code block:
error message:
|
@SogoGolf mark the property you're using as the partition key with the
Docs are lagging behind as we iterate on this, but you can look at the tests which should give you some insight. |
I can't seem to find an example for Java. I tried something like the snipped below, but it's failing. Any hints/pointers? Thanks! static class SampleDocument extends Document {
String guid;
@PartitionKey // <== fails here with "@PartitionKey not applicable to field"
String guid_date;
JSONObject payload;
SampleDocument(...) {}
} |
@radoye thanks for the feedback. I've updated the attribute to work on fields as well. Let me know if this fixes the issue for you. Released in v0.2.5. |
@NateRickard thanks for the fix! I can confirm that it works in 0.2.5. |
* Added multi-stage definition scaffolding.
Bug Information
when calling AzureData.createDocument() to collection with partition key, it produce error : The partition key supplied in x-ms-partitionkey header has fewer components than defined in the the collection.
REST request header missing x-ms-documentdb-partitionkey
Steps to Reproduce
call AzureData.createDocument() to collection with partition key.
Expected Behavior
Actual Behavior
Code snippet
Screenshots
The text was updated successfully, but these errors were encountered: