Comments (5)
Hi @Szeraax - I just saw that too. I'm hoping the REST API's will be updated with this feature as well: https://docs.microsoft.com/en-us/rest/api/cosmos-db/
from cosmosdb.
Closing for now at least.
from cosmosdb.
Hey @PlagueHO, am I reading this right that we now have PATCH capability in the API?
https://learn.microsoft.com/en-us/rest/api/cosmos-db/patch-a-document
from cosmosdb.
Looks like it is supported now and it requires that you use the Patch method with an array of operations. I think the best way to go about implementing this will be to add a PatchOperation type in our module class and then add a Update-CosmosDbDocument
cmdlet. Update-CosmosDbDocument
would have an optional PartitionKey
string param, an optional conditional filter (probably just use -Filter
for the param name), and would require an array of the [PatchOperation]
objects.
Here is the other document that is helpful to look at: https://learn.microsoft.com/en-us/azure/cosmos-db/partial-document-update
Any guidance on my approach? Cool if I take a first pass at a PR or would you like me to do this in a different way?
from cosmosdb.
Regarding the PatchOperation type, I'd need some help creating that class, since I'm a c# noob at best.
I guess a start would be:
public class PatchOperation {
public System.String op { get; set; }
public System.String path { get; set; }
public System.Object value { get; set; }
}
But we'd need to restrict the op to one of the supported operations like add, remove, set, etc. Not sure how to set a validation set in c#. The path would be a string and that's no problem. But the value
would need to be any object type that can convert to json (string, int, float, etc.). Dunno how to appropriately do that in the strongly typed world of c#.
from cosmosdb.
Related Issues (20)
- Bulk Create, Bulk Update and Bulk Delete Documents HOT 7
- Get-CosmosDbDocument -QueryParameters hashtable array is case sensitive HOT 2
- Update Testing on MacOS
- Remove Testing on Windows Server 2016 HOT 1
- Add proxy configuration for internal Invoke-WebRequest
- Enable BaseHostname to be specified manually HOT 1
- Back-off policy (for 429 Errors) throws an exception because the response from the call to Invoke-WebRequest() is not in the expected format. HOT 3
- Convert Build Pipeline MacOS Image to macos-11 HOT 1
- UDF does not store unless escaped HOT 1
- Get-CosmosDbDocument not able to query certain items from a container HOT 3
- New-CosmosDbDocument - PowerShell is returning error "Cannot convert 'System.Collections.ArrayList' to the type 'System.String' required by parameter 'Message'. Specified method is not supported."
- Thank you! HOT 1
- Add Update-CosmosDbDocument and Get-AllCosmosDbDocuments
- Improve documents regarding to CrossPartitionQuery
- Remove Testing on Ubuntu 18.04 from Build Pipeline
- Add Testing on Ubuntu 22.04 from Build Pipeline
- Remove Testing on MacOS 10.15 from Build Pipeline
- Add Testing on macOS-12 to Build Pipeline
- Convert Azure DevOps Pipeline to use Federated Identity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmosdb.