Create : To add new documents to a collection, use the Create
operation.
Read : Data from a collection is retrieved using the Read operation.
Update : The Update operation is used to edit existing documents in
a collection.
Delete : A collection of documents can be deleted using the Delete
procedure.
Two Ways to Create a Collection
Used to retrieve data from the database
Used to modify existing documents in
a collection
Used to remove documents from a
collection.
Indexing
Creating Index
Query Operations
Conditional
$eq
$gt
$lt
$gte
$lte
$in
$ne
Matches values that are equal to the given value.
Matches if values are greater than the given value.
Matches if values are less than the given value.
Matches if values are greater or equal to the given value.
Matches if values are less or equal to the given value.
Matches any of the values in an array.
Matches values that are not equal to the given value.
Logical
$and
$or
$nor
$not
Joins two or more queries with a logical AND and returns the documents that match all the conditions.
Join two or more queries with a logical OR and return the documents that match either query.
The opposite of the OR operator. The logical NOR operator will join two or more queries and return documents that do not match the given query conditions.
Returns the documents that do not match the given query expression.
Aggrigation
1. $match
2. $project:
3. $group:
4. $sort:
5. $skip:
6. $limit:
7. $unwind:
8. $out:
It is used for filtering the documents can reduce the amount of documents that are given as input to the next stage.
It is used to select some specific fields from a collection.
It is used to group documents based on some value.
It is used to sort the document that is rearranging them Aggrigation Pipeline
It is used to write resulting documents to a new collection.
It is used to unwind documents that are using arrays i.e. it deconstructs an array field in the documents to return documents for each elements
It is used to pass first n number of documents thus limiting them.
It is used to skip n number of documents and passes the remaining document