MongoDB Shell/Mongo Client commands
mongo
mongo --version
mongo 172.33.28.212
mongo <hostname>:<PORT>
mongo "mongodb://admin:secret@ec2****.amazonaws.com/admin"
mongo --host rs9/localhost:27017,localhost:27018,localhost:27019
mongo mongodb://mongodb0,mongodb1,mongodb2/replicaSet=rs0
help
db.help()
sh.help()
rs.help()
interpreterVersion()
version()
db.version()
db.serverBuildInfo()
db # current active database
show dbs
use test
show collections
rs.status()
db.stats()
db.getCollection("test").insertOne( {a:10, b:true} )
> x = 100;
> x / 5;
typeof db
typeof obj.a;
obj.c instanceof Array;
cls
exit
db.shutdownServer()
Related MongoDB Articles:
No comments:
Post a Comment