20
Total Commands
100%
Free Access
⚡
Lightning Fast
Available Commands
Click on any command to copy it instantly
20 commands available
20 of 20
Resources
Master MongoDB
Become proficient in MongoDB NoSQL database
mongo --host localhost --port 27017mongodb
connect
cli
show dbsmongodb
databases
list
use mydbmongodb
database
select
show collectionsmongodb
collections
list
db.users.insertOne({name: 'Alice', age: 25})mongodb
insert
document
db.users.insertMany([{name:'Bob', age:30}, {name:'Charlie', age:28}])mongodb
insert
multiple
db.users.find()mongodb
find
query
db.users.find({age: 25})mongodb
find
filter
db.users.updateOne({name:'Alice'}, {$set:{age:26}})mongodb
update
document
db.users.updateMany({age:25}, {$set:{active:true}})mongodb
update
multiple
db.users.deleteOne({name:'Alice'})mongodb
delete
document
db.users.deleteMany({age:30})mongodb
delete
multiple
db.users.createIndex({name:1})mongodb
index
performance
db.users.dropIndex('name_1')mongodb
index
drop
db.users.countDocuments()mongodb
count
query
db.orders.aggregate([{$match:{status:'pending'}}, {$group:{_id:'$item', total:{$sum:'$qty'}}}])mongodb
aggregate
analytics
db.users.distinct('age')mongodb
distinct
query
db.users.drop()mongodb
drop
collection
db.users.renameCollection('customers')mongodb
rename
collection
db.dropDatabase()mongodb
drop
database
Missing a command?
Help us improve this collection by suggesting commands that should be added. Your contributions help the entire developer community!