Introduction Flashcards

1
Q

How do you create a database in MongoDB?

A

use database_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you switch databases?

A

use database_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are tables in MongoDB called?

A

Collections

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are records in MongoDB called?

A

Documents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you display all the documents in a collection?

A

db.collection_name.find();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you see all the databases in your MongoDB server?

A

show databases;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you end a session in MongoDB?

A

quit()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you see all the collections within a database?

A

show collections;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you create a collection?

A

db.collection_name.insertOne();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How are document IDs created in MongoDB?

A

MongoDB automatically generates IDs for each document.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly