This project has moved and is read-only. For the latest updates, please go here.

Could I use update operators to modify specific fields within the document?

Nov 28, 2012 at 8:55 AM

To update a document in MongoDB, two ways: replace the document altogether or use some combination ofupdate operators to modify specific fields within the document.

Would you say more details? 

I haven't found any pages talk about this.



Nov 28, 2012 at 9:43 AM

like this,

Nov 28, 2012 at 4:15 PM
Edited Nov 28, 2012 at 4:17 PM

MongoRepository doesn't support this; that is because MongoRepository is simply a Repository pattern implementation (e.g. abstraction layer) on top of the Mongo C# driver; specifying which fields to write/update is of no concern to a ("generic") repository implementation (e.g it is an implementation-specific (mongodb) concern). You are, however, ofcourse free to simply use (and reference) the mongocsharpdriver directly (which is installed and referenced anyway by the MongoRepository package).