Recommend this page to a friend! |
Classes of Xavier Pérez | XMongoDB | doc/4-basic-iud-operations.md | Download |
|
DownloadBasic Insert / Update / Delete OperationsInsert OptionsInsert one documentIf you are inserting only one document:
References: http://docs.mongodb.org/manual/reference/method/db.collection.insert/ Insert multiple documentsIf you are inserting a group of documents:
References: http://docs.mongodb.org/manual/reference/method/db.collection.insert/ Update OptionsUpdate a single documentBefore an update, you must to specify a where condition:
This method only will update first collection found in the where condition. Specify an unique key to be sure you update the correct document. - $options:
References : http://docs.mongodb.org/manual/reference/method/db.collection.update/ Update multiple documents
References : http://docs.mongodb.org/manual/reference/method/db.collection.update/ Update using SET
References: http://docs.mongodb.org/manual/reference/operator/update/set/ Delete OptionsDelete a single document
Delete multiple documents
References: http://docs.mongodb.org/manual/reference/method/db.collection.remove/ Reconnect to another mongoDB instanceAfter you have created the config class, you can reuse to another connection:
|