Common shell for mongodb and mongodbshell
> Use cmd_test // create a database
Switched to db pai_test
> Db. createCollection ("test") // create a table as a set.
{"OK": 1}
> Db.
Db. addUser (db. group (
Db. adminCommand (db. groupcmd (
Db. auth (db. groupeval (
Db. changeUserPassword (db. hasOwnProperty (
Db. cloneCollection (db. help (
Db. cloneDatabase (db. hostInfo (
Db. commandHelp (db. isMaster (
Db. constructor db. killOP (
Db. copyDatabase (db. killOp (
Db. createCollection (db. listCommands (
Db. createRole (db. loadServerScripts (
Db. createUser (db. logout (
Db. currentOP (db. printCollectionStats (
Db. currentOp (db. printReplicationInfo (
Db. dbEval (db. printShardingStatus (
Db. dropAllRoles (db. printSlaveReplicationInfo (
Db. dropAllUsers (db. propertyIsEnumerable (
Db. dropDatabase (db. prototype
Db. dropRole (db. removeUser (
Db. dropUser (db. repairDatabase (
Db. eval (db. resetError (
Db. forceError (db. revokePrivilegesFromRole (
Db. fsyncLock (db. revokeRolesFromRole (
Db. fsyncUnlock (db. revokeRolesFromUser (
Db. getCollection (db. runCommand (
Db. getCollectionNames (db. serverBits (
Db. getLastError (db. serverBuildInfo (
Db. getLastErrorCmd (db. server‑lineopts (
Db. getlasterrobj (db. serverStatus (
Db. getMongo (db. setProfilingLevel (
Db. getName (db. setSlaveOk (
Db. getPrevError (db. setWriteConcern (
Db. getProfilingLevel (db. shutdownServer (
Db. getProfilingStatus (db. stats (
Db. getReplicationInfo (db. system. indexes
Db. getRole (db. test
Db. getRoles (db. toLocaleString (
Db. getSiblingDB (db. toString (
Db. getSisterDB (db. tojson (
Db. getSlaveOk (db. unsetWriteConcern (
Db. getUser (db. updateRole (
Db. getUsers (db. updateUser (
Db. getWriteConcern (db. upgradeCheck (
Db. grantPrivilegesToRole (db. upgradeCheckAllDBs (
Db. grantRolesToRole (db. valueOf (
Db. grantRolesToUser (db. version (
The above is a common shell
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.