Tsallaka zuwa abun ciki
Justice Tech School

Databases, Collections and Documents

A database holds collections, a collection holds documents. Compared with SQL: collection is like a table, document like a row, field like a column. Databases and collections are created when you first insert into them.

Example
use school
db.students.insertOne({ name: "Ada" })
show collections
// students

Exercise

Switch database.

 school

Quiz Test

What is a collection?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.