Mongodb Operators Cheat Sheet

Posted on  by 



MongoDB is open-source, NoSQL database that stores data in a JSON-like document. It has highly flexible and dynamic data model which is faster, agile and scalable. It evolves to meet the need to manage the growing size and complexity of data. This post is all about MongoDB cheat sheet for quick reference. MySQL & MongoDB.

  1. Mongo -u USERNAME -p PASSWORD -authenticationDatabase DATABASENAME For user created in above command, the login command would look like the following: mongo -u ajitesh -p gurukul -authenticationDatabase testdb Database Cheat Sheet, MongoDB Cheat Sheet.
  2. Performance tuning is not trivial, but you can go a long way with a few basic guidelines. In this blog, we will discuss how you analyze the workload of your MongoDB production systems, and then we’ll review a list of important configuration parameters that can help you improve performance.
  3. View Notes - Mongo Shell Cheat Sheet from IPD 451 at DePaul University. Shell cheat sheet for MongoDB version 2.4 Database Administration CRUD Queries Analytic Queries Command line tools Query.

MongoDB version: 3.6+ - Date: April 2018

Sheet

Mongodb Cheat Sheet Pdf

Document : A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB documents are very similar to JSON objects. Values may include other documents, arrays, and arrays of documents.

Note : each document requires a unique _id field (uses the ObjectId BSON type) that acts as a primary key. The MongoDB driver generates it if omitted.

Collection : A grouping of MongoDB documents. A collection is the equivalent of an RDBMS table. Collections do not enforce a schema by default. Documents within a collection can have different fields but should have a similar or related purpose.

Each value of a field/value pair is recorded as a BSON type. BSON is a binary serialization format. The most used and useful BSON types in MongoDB are (each BSON type has both integer and string identifiers) :

Mongodb Array Operators

  • Double : 1 'double'
  • String : 2 'string'
  • Object : 3 'object'
  • Array : 4 'array'
  • ObjectId : 7 'objectId'
  • Boolean : 8 'bool'
  • Date : 9 'date'
  • Null : 10 'null'
  • 32-bit integer : 16 'int'
  • 64-bit integer : 18 'long'
  • Decimal128 : 19 'decimal'

Mongodb Like Operator

Note : Timestamp data type is for internal MongoDB use. You will want to use the BSON date type.





Coments are closed