MongoDB
MongoDB is a document database designed for ease of development and scaling.
Document Database
- A record in MongoDB is a document, which is a data structure composed of field and value pairs.
- It is similar to JSON.
- Example
{
name: "Cypher",
rank: "Radiant",
location: "Morocco",
type: "Sentinel"
}
Advantages of using documents:
- Documents (objects) correspond to native data types in many programming languages.
- Embedded documents and arrays reduce need for expensive joins.
- Dynamic schema supports fluent polymorphism.
Connect MongoDB with Node.js
- Install the MongoDB Node driver
npm install mongodb
- Check out this documentation - MongoDB Node Driver