Practical 4 NoSQL PARTH
Practical 4 NoSQL PARTH
PRACTICAL – 4
AIM: Indexing , Aggregation and Map Reduce in NoSQL-DB.
1. Indexing
Default_id Index :
This is a unique Index created on the ID field of the collection. Please note that we cannot
drop this Index, as it’s the default.
db.Asset.getIndexes()
Apart from the Default_id Index created by MongoDB, it allows us to create a user-defined
Index
db.Asset_038.createIndex( { Name : 1 } )
Compound Index :
MongoDB allows us to create a single structure to refer multiple fields.
db.Asset_038.getIndexes()
2. Aggregation
Aggregations operations process data records and return computed results. Aggregation
operations group values from multiple documents together, and can perform a variety of
operations on the grouped data to return a single result. In SQL count(*) and with group by is an
equivalent of mongodb aggregation