Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

MongoDB Exam C100DBA Topic 1 Question 64 Discussion

Actual exam question for MongoDB's C100DBA exam
Question #: 64
Topic #: 1
[All C100DBA Questions]

Given a collection posts as shown below having a document array comments, which of the following command will create an index on the comment author descending?

Show Suggested Answer Hide Answer
Suggested Answer: A, B, C

Contribute your Thoughts:

Rosalyn
9 days ago
I think the answer is A. db.posts.createIndex({\'^comments.$.author\':-1}). It seems to create an index on the 'author' field of the 'comments' subdocument in descending order.
upvoted 0 times
...
Susana
16 days ago
I'm not sure, but I think option A might be correct as it mentions creating an index on comment author in descending order.
upvoted 0 times
...
Delisa
18 days ago
The correct answer is B. db.posts.createIndex({\'comments.author\':1}). The command creates an index on the 'author' field of the 'comments' subdocument in the 'posts' collection, in ascending order.
upvoted 0 times
...
Marshall
18 days ago
I agree with Chara, option B seems to be the right choice because it specifies the index on comment author in ascending order.
upvoted 0 times
...
Chara
19 days ago
I think the correct command is B) db.posts.createIndex({^comments.author :1});
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77