Database IntegrationLesson 59Free preview
MongoDB Get Started
This lesson is part of Node.js · All levels
Summary
This lesson introduces MongoDB to developers: a document-based NoSQL database that stores data in a JavaScript-like JSON format. You learn to install the official mongodb driver, make connections to the MongoClient, and run basic commands like insert and find. Because of its flexible schematics, MongoDB is suitable for data that has a frequently changing structure. (Node.js)
Key points
- MongoDB stores documents (JSON-like BSON) in the collection, not rows in the table.
- The official 'mongodb' module is installed via npm install mongodb.
- MongoClient with the connect() method (or constructor) opens the connection to the server.
- Collections and databases are lazily created: they appear when they are first written.
- The result is a cursor; it is converted into an array of documents.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.