Do you want to setup your MEAN stack (MongoDB, Express, AngularJS and Node.js) application on Azure App Services with Continuous Integration and Delivery? Here are step by step videos to deploy a MEAN application to Azure Web Apps via GitHub and store the app’s data inside Cosmos DB (a drop-in replacement for MongoDB).
Category: MongoDB
All posts related to MongoDB
MongoDB Query: $elemMatch vs. Dot Notation
In MongoDB query, Dot notation is to match by specific fields in an embedded document. When the field holds an array of embedded documents, then to match the field, concatenate the name of the field that contains the array, with a dot (.) and the name of the field in the embedded document.
{ <array field name>.<embedded document field> : <value> }
To specify multiple criteria on an array of embedded documents such that AT LEAST ONE embedded document satisfies all the specified criteria, $elemMatch operator is used.
{ <array field name>: { $elemMatch: { <query1>, <query2>, ... } } }
Let us take an example to understand it. Consider schoolinfo collection includes following documents
MongoDB Aggregation Query: Getting All Records having Max Value
In this post, we will write a query using MongoDB aggregate method to get all records having Max (Highest) value for specific field. If you are new to aggregation framework, I would recommend to read following post first:
MongoDB Query: Select and Filter Child Array
Consider a collection school with the following documents:
MongoDB Query: Select and Filter Child Array
If you are using embedded document to model one to many relationships in MongoDB, sometimes you might need to get child data only depends on the report. This post explains some experiments related to select and filter child array with MongoDB queries. Consider a collection school with the following documents: