how do I select all rows from a table in Mongodb in the console? how do I select all rows from a table in Mongodb in the console? mongodb mongodb

how do I select all rows from a table in Mongodb in the console?


MongoDB is a different type of database than your traditional RDBMS. Instead of tables, Mongo uses collections and instead of rows, Mongo uses documents.

The way to do this in Mongo is as follows

db.collectionName.find()

This will return a collection of objects

{"_id": ObjectId("559d85cc9ab227e79da027252"), "name": "Edward"},{"_id": ObjectId("559d85ef9ab227e79da027252"), "name": "Joseph"}

An excellent resource for Comparison is

https://www.mongodb.com/compare/mongodb-mysql