Skip to content
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

Document passing partitionKey to deleteDocument method when used with partitioned collection #195

Closed
harshithkashyap opened this issue May 14, 2017 · 4 comments

Comments

@harshithkashyap
Copy link

From the docs here, deleteDocument takes only _self link of the document as the mandatory parameter. But when the query is run against a partitioned collection, cosmosdb throws the following error:

{"errors":["The partition key supplied in x-ms-partitionkey header has fewer components than defined in the the collection."]}

As suggested by this SO answer, passing partition key via options object as below works.

deleteDocument(documentLink, {
    partitionKey: ['partitionKeyValueForTheDocument']
}, callback)
@tony-gutierrez
Copy link

This also makes it impossible to delete documents that were saved without a partition key. Also the PartitionKey(Undefined.value) seems to be missing from the node sdk.

@srinathnarayanan
Copy link
Contributor

@harshithkashyap deleteDocument needs the partitionKey to be passed via the request Options. The docs have been updated to reflect the same. Thanks.

@tony-gutierrez
Copy link

That still doest address the fact that the Undefined.value constant is missing from the node SDK.

@srinathnarayanan
Copy link
Contributor

@tony I have provided a work around on this thread : #222. Please check that out and let us know if you had any other questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants