Answers for "how to execute dos command from mongo shell"

2

open mongodb in cmd

1) Go to MongoDB bin folder:
		C:Program FilesMongoDBServer3.2bin
2) Enter command mongod
		By default, mongodb server will start at port 27017
Posted by: Guest on April-28-2021
15

mongo shell commands

show dbs # <=> Print a list of all databases on the server.
use <db> # <=> Switch current database to <db>
show collections # <=> Print a list of all collections for current database.
db.people.insert({name:"Ashwin",gender:"m"}) # <=> Inserts a new "person" collection with a new object in that collection
db.people.find(<any attributes or none>) # <=> Find all persons in the collection
db.people.update({name:"Ashwin"},{gender:"f"}) # <=> Updates the selected (1st parameter) person with new value(2nd parameter)
db.people.remove({name:"Ashwin"}) # <=> Remove where name is "Ashwin"
db.people.drop() # <=> Delete the "people" collection
Posted by: Guest on September-22-2020

Code answers related to "how to execute dos command from mongo shell"

Browse Popular Code Answers by Language