mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-11 01:10:31 +00:00
31 lines
420 B
Plaintext
31 lines
420 B
Plaintext
|
// Show current database
|
||
|
db
|
||
|
|
||
|
// Select or switch database
|
||
|
use mydb
|
||
|
|
||
|
// Execute a JavaScript file
|
||
|
load(myscript.js)
|
||
|
|
||
|
// Display help
|
||
|
help
|
||
|
|
||
|
// Display help on DB methods
|
||
|
db.help()
|
||
|
|
||
|
// Display help on Collection
|
||
|
db.mycol.help()
|
||
|
|
||
|
// Show all databases
|
||
|
show dbs
|
||
|
|
||
|
// Show all collections in current database
|
||
|
show collections
|
||
|
|
||
|
// Show all users on current database
|
||
|
show users
|
||
|
|
||
|
// Show all roles on current database
|
||
|
show roles
|
||
|
|