Kizspy | Question: 9
(Choose 1 answer)
You need to connect to a MongoDB server, create a new database named 'library', create a collection named 'books' within the 'library' database, and list all databases on the server. Arrange positions in order:
A. Step 1 is to create a new database reference using client.db('library')
Step 2 is to create a new collection using await db.createCollection('books');
Step 3 is to list all databases using await adminDb.listDatabases();
B. Step 1 is to create a new collection using await db.createCollection('books');
Step 2 is to create a new database reference using client.db('library')
Step 3 is to list all databases using await adminDb.listDatabases();
C. Step 1 is to list all databases using await adminDb.listDatabases();
Step 2 is to create a new collection using await db.createCollection('books');
Step 3 is to create a new database reference using client.db('library')
D. Step 1 is to list all databases using await adminDb.listDatabases();
Step 2 is to create a new database reference using client.db('library')
Step 3 is to create a new collection using await db.createCollection('books');
FUOVER