MongoDB CRUD

357

Mogo Shell

For more documentation of basic MongoDB operations in the mongo shell, see:

1. Query method

For the db.collection.find() method, you can specify the following optional fields:

  • a query filter to specify which documents to return.
  • a query projection to specifies which fields from the matching documents to return. The projection limits the amount of data that MongoDB returns to the client over the network.
  • You can optionally add a cursor modifier to impose limits, skips, and sort orders. The order of documents returned by a query is not defined unless you specify a sort().

    Example: https://docs.mongodb.com/manual/reference/method/db.collection.find/#db.collection.find

2. Insert Methods

MongoDB provides the following methods for inserting documents into a collection:

Additional Methods

The following methods can also add new documents to a collection:

3. Update

4. Delete

 

Backup and Test MongoDB:

 

SHARE
Previous articleCác website lập trình
Next articleAndroid HTTPS

NO COMMENTS