Commands
enter into console
mongo
show databases
show dbs
switch to specific db
use dev_db
show collections (tables)
show collections
show structure
db.room_inventories.find().pretty()
- There is no way to only view structure, must through a document. Choose one record from the list to view its structure.
find
does not retrieve all the data in a collection by default
show index
db.room_plan_rates.getIndexes()
query documents
db.room_plan_rates.find({ hotel_id: 192, plan_code: 'R1363HP19216916370545220559650-1', date: ISODate('2023-08-12') }).pretty()