General Commands Flashcards
1
Q
List commands that can be run when NOT connected to a DB
A
help
2
Q
Show databases
A
show dbs
3
Q
Show current database name
A
db
4
Q
Switch to database
A
use dbName
5
Q
Show collections within database
A
show collections
6
Q
List commands that can be run on current DB
A
db.help()
7
Q
List commands that can be run on collection
A
db.collection.help()
8
Q
Writing a method with invoking it does what?
A
Returns the actual source code of the function, so you can see how it works.
Example
db.name.find