0
0
MongoDBquery~10 mins

Document size limits and structure rules 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 check the maximum document size allowed in MongoDB.

MongoDB
maxSize = [1]
Drag options to blanks, or click blank then click option'
A33554432
B1048576
C16777216
D8388608
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing kilobytes with megabytes.
Using the maximum size for collections instead of documents.
2fill in blank
medium

Complete the code to create a document with a nested structure in MongoDB.

MongoDB
document = {"name": "Alice", "address": [1]
Drag options to blanks, or click blank then click option'
Anull
B{"city": "NY", "zip": "10001"}
C"city: NY, zip: 10001"
D["city", "NY", "zip", "10001"]
Attempts:
3 left
💡 Hint
Common Mistakes
Using arrays instead of objects for nested fields.
Using strings instead of objects for nested documents.
3fill in blank
hard

Fix the error in the document structure to comply with MongoDB rules.

MongoDB
document = {"_id": ObjectId(), "name": "Bob", "age": [1]
Drag options to blanks, or click blank then click option'
A25
B[25]
C"twenty-five"
D{"value": 25}
Attempts:
3 left
💡 Hint
Common Mistakes
Storing numbers as strings.
Using arrays for single values.
4fill in blank
hard

Fill both blanks to create a valid MongoDB document with an array and a nested document.

MongoDB
document = {"tags": [1], "profile": [2]
Drag options to blanks, or click blank then click option'
A["mongodb", "database"]
B{"age": 30, "city": "LA"}
C["age", 30]
D"profile info"
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings instead of arrays for tags.
Using arrays instead of objects for nested documents.
5fill in blank
hard

Fill all three blanks to define a MongoDB document with a nested document, an array, and a numeric field.

MongoDB
document = {"user": [1], "roles": [2], "score": [3]
Drag options to blanks, or click blank then click option'
A{"name": "Eve", "email": "eve@example.com"}
B["admin", "editor"]
C95
D"95"
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings instead of objects or arrays.
Storing numbers as strings.