Skip to content

trandung2k1/express_professional

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using mongosh

  1. Dowload mongosh
https://www.mongodb.com/docs/mongodb-shell/
  1. Open terminal check version
mongosh --version
  1. Start mongosh
mongosh;
  1. Show all databases
show databases
show dbs
  1. Use database
use databaseName
  1. Show collections, tables
show tables
db.getCollectionNames()
show collections
  1. Show fields
Object.keys(db.posts.findOne());
  1. Select fields
db.posts.find({}, { _id: 0, title: 1, body: 1 });