munshi.devMongoDB 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...Feb 1, 2021路5 min read
munshi.devMongoDB 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: { ...Jan 31, 2021路3 min read
munshi.devMongoDB 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 ...Jan 30, 2021路7 min read
munshi.devMongoDB 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...Jan 29, 2021路4 min read
munshi.devMongoDB 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...Jan 28, 2021路4 min read