nerdexam
MongoDB

C100DBA · Question #36

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?

Sign in or unlock C100DBA to reveal the answer and full explanation for question #36. The question stem and answer options stay visible for context.

Performance Tuning

Question

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?

Exhibit

C100DBA question #36 exhibit

Options

  • Adb.posts.createIndex({commerits.$.author":-l});
  • Bdb.posts.createIndex({comments.$.author": {$desc:l>});
  • Cdb.posts.createIndex({comments.author":-l});

Unlock C100DBA to see the answer

You've previewed enough free C100DBA questions. Unlock C100DBA for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#index creation#array index#nested documents#descending index
Full C100DBA Practice