MONGO DB is Document document-oriented Database also Documents are grouped into collections, similar to SQL relational database. It's a powerful query language that allows complex query sets and aggregations. High scalability which is designed in Horizontally, allows for data distribution across multiple servers.
In SQL server querying like Database, tables, row and column. Similar way in the MONGO DB Database, collections, document (BSON), and field. So Will see about query the field by find and search. Some of queries examples is here.
db.collection.find();
db.collection.aggregate([
{
$match: {
id: "123"
}
}
]);
With the help of the Online MONGO DB Compiler, Here, we will explore.
Input Data
[
{
_id: 1,
name: "Ryan",
gender: "M",
age: 12
},
{
_id: 2,
name: "Joanna",
gender: "F",
age: 13
}
]
Output