0
0
MongoDBquery~10 mins

Atlas connection string setup in MongoDB - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the MongoDB connection string with the correct protocol.

MongoDB
mongodb+srv://[1]
Drag options to blanks, or click blank then click option'
Ausername:password@cluster0.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to include the protocol mongodb+srv://.
Using http:// or other protocols instead.
2fill in blank
medium

Complete the connection string to specify the database name after the cluster address.

MongoDB
mongodb+srv://username:password@cluster0.mongodb.net/[1]?retryWrites=true&w=majority
Drag options to blanks, or click blank then click option'
Aadmin
Btest
CmyFirstDatabase
Dlocal
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving the database name blank.
Using system database names like admin unless intended.
3fill in blank
hard

Fix the error in the connection string by choosing the correct query parameter to enable retryable writes.

MongoDB
mongodb+srv://username:password@cluster0.mongodb.net/myFirstDatabase?[1]=true&w=majority
Drag options to blanks, or click blank then click option'
Aretry
BretryWrites
Cretry_write
DretryWrite
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the parameter name.
Using underscores or lowercase incorrectly.
4fill in blank
hard

Fill both blanks to complete the connection string with the correct write concern and authentication source.

MongoDB
mongodb+srv://username:password@cluster0.mongodb.net/myFirstDatabase?retryWrites=true&w=[1]&authSource=[2]
Drag options to blanks, or click blank then click option'
Amajority
Badmin
Clocal
Dprimary
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect values for w or authSource.
Omitting these parameters when needed.
5fill in blank
hard

Fill all three blanks to complete the connection string with username, password, and cluster address.

MongoDB
mongodb+srv://[1]:[2]@[3]/myFirstDatabase?retryWrites=true&w=majority
Drag options to blanks, or click blank then click option'
AmyUser
BmyPassword123
Ccluster0.mongodb.net
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping username and password positions.
Using localhost instead of the Atlas cluster address.