MongoDB Tutorial
Table of Contents
- Introduction to MongoDB
- Installation
- Creating a Database
- Creating a Collection
- Inserting Data
- Querying Data
- Updating Data
- Deleting Data
Introduction to MongoDB
MongoDB is a popular open-source NoSQL database that provides high performance, high availability, and automatic scaling.
Installation
To install MongoDB, follow the instructions provided in the official MongoDB documentation.
Creating a Database
use mydatabase
Creating a Collection
db.createCollection("mycollection")
Inserting Data
db.mycollection.insertOne({
name: "John Doe",
age: 30,
email: "john@example.com"
})
Querying Data
db.mycollection.find()
Updating Data
db.mycollection.updateOne(
{ name: "John Doe" },
{ $set: { age: 35 } }
)
Deleting Data
db.mycollection.deleteOne({ name: "John Doe" })
No comments:
Post a Comment