Update
Partial document update.
Last updated
Was this helpful?
Partial document update.
Last updated
Was this helpful?
When you need to update only part of the document, you can specify which properties should be updated. You can benefit from it in many ways: you don't need to prefetch all the data upfront, reduce the payload of a request, increment some property without replacing the entire document, ... If you want to replace the entire document, please refer to ReplaceOne action.
Check the information about entities on how your class objects are serialized.
Check the docs on how to form filters.
When you need to update only part of the document, you can specify which properties should be updated. You can benefit from it in many ways: you don't need to prefetch all the data upfront, reduce the payload of a request, increment some property without replacing the entire document, ... If you want to replace the entire document, please refer to ReplaceOne action. https://docs.codemash.io/api/database/collections/update
/{version}/db/{CollectionName}//{Id}
Id of a record to update. Required if filter is empty.
Collection name - unique, lowercased, collection name without whitespace. E.g., if your collection title you have entered in the CodeMash dashboard is "Business Trips" then collection name would be "business-trips".
The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v2
Accept Header
API key of your cluster. Can be passed in a header as X-CM-Cluster.
ID of your project. Can be passed in a header as X-CM-ProjectId.
Specify culture code when your response from the API should be localised. E.g.: en
When you need to update only part of the document, you can specify which properties should be updated. You can benefit from it in many ways: you don't need to prefetch all the data upfront, reduce the payload of a request, increment some property without replacing the entire document, ... If you want to replace the entire document, please refer to ReplaceOne action. https://docs.codemash.io/api/database/collections/update
/{version}/db/{CollectionName}
Collection name - unique, lowercased, collection name without whitespace. E.g., if your collection title you have entered in the CodeMash dashboard is "Business Trips" then collection name would be "business-trips".
The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v2
Accept Header
API key of your cluster. Can be passed in a header as X-CM-Cluster.
ID of your project. Can be passed in a header as X-CM-ProjectId.
Specify culture code when your response from the API should be localised. E.g.: en