Introduction
Welcome to the world of MongoDB! If you're new to databases and want to learn how to manage them effectively, you're in the...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
Hi all, there are also other MongoDb commands that can be useful
Indexing Commands:
Creating an Index: db.collection.createIndex({ field: 1 })
Viewing Indexes: db.collection.getIndexes()
Dropping an Index: db.collection.dropIndex("index_name")
Aggregation Commands:
Aggregation Pipeline: db.collection.aggregate([pipeline])
Grouping Documents: $group
Filtering Documents: $match
Projecting Fields: $project
Sorting Documents: $sort
Backup and Restore Commands:
Exporting Data: mongoexport
Importing Data: mongoimport
Database Dump: mongodump
Database Restore: mongorestore
Thanks for sharing!!
Here is a useful one:
db.version()
. This shows the version of the database server you are connected to.Wow, I wasn't aware of this command. Thank you so much for sharing, Prasad!!
Tank you! 👏👏
My pleasuee
Hi Madhu Saini,
Your tips are very useful
Thanks for sharing
Thanks :)
Thanks for that, always good to remember some commands and learn new ones. Great post!
Glad it helped, Thanks for the feedback Lucas
I don't even remember when I last used db commands. I always use mongoose. but nice post though
Hope it refreshed your commands, Thanks Anjan :)
Very useful....and existing information....
Thanks Rohit!
Thank you!
Great to job
Thanks you,. I hope you will soon write a tutorial on connecting mongodb + Nodejs
Gonna write that soon,
Thank you so much for the feedback :)
creating DB users is also important when you move to prod DB
True that
Prisma ORM is better I think 🤔
No Doubt it's better, but still many people use MongoDB and it's better to use mongo itself for simpler project and dbs
Thanks alot
Useful material, thanks !
Thanks Sandro :)
Thanks for the helpful insights, Madhu. I was planning to use MongoDB for a client, and this was well put together.
Awesome!
Glad it helped, Thanks for the feedback Zack!
All the best for your next project :)
Thank you
Wow really helpful.
Glad it helped, Thanks for the feedback :)