PdfPrep.com

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?

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?

A . db.posts.createIndex({commerits.$.author":-l});
B . db.posts.createIndex({comments.$.author": {$desc:l>});
C . db.posts.createIndex({comments.author":-l});

Answer: C

Exit mobile version