Databases

MongoDB Aggregation and Modeling

Part 2 of 5

Advanced queries, aggregation pipelines, and data modeling

Mongo DB: Using compass for "aggregate" querying

Implementing a model with MongoDB


Implementing a model with MongoDB(2)

In MongoDB it is possible to add successively those 2 documents:


db.users.insertOne({
    name:'Estelle'
})
db.users.insertOne({
    email:'miguel@somecompany.com'
})
db.users.find();
    

which leads to this following result

_id,name,email 606b01da0536c900a0a43632,Estelle, 606b023e0536c900a0a43634,,miguel@somecompany.com

Implementing a model with MongoDB (3)

Is it possible to use this kind of data in an application?

Answer? No!

Schema-less DB : a viable approach (with a bit of Schema!)

What's a good approach to converge to a usable result?

Modeling exercise

Remember this? How to model it properly in the NoSQL approach?

quiz manager app

Modeling exercise (2)

Nested documents or references?

Modeling exercise (3)

Trieuse de diapositives