How to get a count of modified documents via update
See original GitHub issueFor example we have a code:
DB.Update<Profile>()
.Match(a => a.Nick== nick && a.Money >= 10)
.Modify(b => b.Inc(a => a.Money , -10))
.Modify(b => b.CurrentDate(a => a.ModifiedOn))
.Execute();
How can we understand was it applied or not? Can we get a count of modified documents?
PS. Thanks for the library.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to count how many sub-documents have been ...
You can use findOneAndUpdate which can return the updated document (or a projection) - possibly this can be used to determine the change...
Read more >Getting to count of documents where modified older than ...
You can use a CAML query to get the count of documents. You can use PowerShell to get all the files not modified...
Read more >Count of records when using modify statement
Hi All , when i am using the modify statement to modify the custom table , i need to know how many records...
Read more >Why Matchedcount is different than Modified Count in ...
I have tried collection.bulk_write(bulkset) for insert, update as well as delete operations. But, matchcount and modifiedcount / insertcount ...
Read more >db.collection.update()
By default, the db.collection.update() method updates a single document. Include the option multi: true to update all documents that match the query criteria....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rzer just released v11.8. all save/update/delete endpoints now return results where you can get the stats you wanted like in official driver.
@paolobriones thanks for the vote of confidence buddy!
Thanks!
I found that your library is the great wrapper for standart MongoDB driver. It’s only one barrier for me now to use it in my project. This functionality will be very helpfull for me. I really appreciate your work!