MongoDB Basic Shell Commands (part-7)MongoDB Basic Shell Commands (part-6) Aggregation Framework Aggregation framework in its simple form is just another way to query data in MongoDB. It can do whatever the MongoDB Query Language (MQL) can do and more. Let us switch to the sample_airb...5 min read路munshi.devFeb 1, 2021
MongoDB Basic Shell Commands (part-6)MongoDB Basic Shell Commands (part-5) Array Operators $elemMatch $elemMatch allows us to have access to the sub-document of an array field. We have a database sample_training, where one of the documents of the grades collection looks like this: { ...3 min read路munshi.devJan 31, 2021
MongoDB Basic Shell Commands (part-5)MongoDB Basic Shell Commands (part-4) Array Operators $push Allows us to add an element to an array. Turns a field into an array field if it was previously a different type. The following command updates one document in the grades collection where ...7 min read路munshi.devJan 30, 2021
MongoDB Basic Shell Commands (part-4)MongoDB Basic Shell Commands (part-3) Expressive Query Operator : $expr $expr => Expressive $expr allows the use of aggregation expressions within the query language. Syntax: { $expr: { <expression> } } $expr allows us to use variables and conditi...4 min read路munshi.devJan 29, 2021
MongoDB Basic Shell Commands (part-3)MongoDB Basic Shell Commands (part-2) Deleting Documents and Collections deleteOne() and deleteMany() Syntax : db.collection.deleteOne(<query>) and db.collection.deleteMany(<query>). The following command deletes all the documents that have test fiel...4 min read路munshi.devJan 28, 2021