Grokking MongoDB
Vote

0% completed

​

Read/Query Documents

How does a program get back only the documents it needs, and only the fields of those documents that it will use? MongoDB answers with two methods, find() and findOne(), and each one takes a query filter and a list of fields. The difference between them is what they return.

This lesson uses five users throughout.

db.users.drop() db.users.insertMany([ { name: "Alice", age: 25, email: "alice@example.com" }, { name: "Bob", age: 30, email: "bob@example.com" }, { name: "Charlie", age: 35, email: "charlie@example.com" }, { name: "Dave", age: 40, email: "dave@example

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content