What is MongoDB?
MongoDB stores data in BSON (binary JSON) format, offering schema-less flexibility and fast development cycles.
Installing MongoDB
Use the official website or run:
brew tap mongodb/brew
brew install mongodb-community@6.0
Creating a Document
db.users.insertOne({
name: "Alice",
email: "alice@example.com",
created_at: new Date()
});
Querying Data
db.users.find({ name: "Alice" })
MongoDB works well with Node.js using the Mongoose library for schema validation.