Module2 Mycontent
Module2 Mycontent
• A key value store uses a hash table in which there exists a unique key and
• Imagine key value stores to be like a phone directory where the names of the
• Key value stores have no default query language. You retrieve data using get,
put, and delete commands. This is the reason it has high performance.
data.
Nodes and relationships are the essential constituents of graph databases. A node represents
Graph database requires only storing data once (nodes). The different types of relationships
The relationships between the nodes are predetermined, that is, it is not determined at query
time.
Example: This image is how MySQL works where it has to perform many operations to find a correct result for Alice.
A graph database, which predetermines relationships.
Aggregation is a way of processing a large number of documents in a collection
by means of passing them through different stages.
The stages make up what is known as a pipeline.
The stages in a pipeline can filter, sort, group, reshape, and modify documents
that pass through the pipeline.
•$match stage – filters those documents we need to work with, those that fit our needs
•$sort stage – sorts the resulting documents the way we require (ascending or
descending)
db.collectionName.aggregate(pipeline, options)
: :
{ field { $mod [ divisor, remainder ] } }
db.std.aggregate([ { $match: { "continent": "North America" } }] )
db.col1.aggregate([ { $match: { gender: "male" } }, { $group: { _id: '$department.name', totalEmployees: { $sum: 1 } } }])