This project has moved. For the latest updates, please go here.

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

Nov 28, 2012 at 7: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 8:43 AM

like this,

Nov 28, 2012 at 3:15 PM
Edited Nov 28, 2012 at 3: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).