nerdexam
MongoDB

C100DBA · Question #22

Consider the following posts document: Which of the following queries will return the documents but with only the first two tags in the tags array?

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

MongoDB Fundamentals

Question

Consider the following posts document:

Which of the following queries will return the documents but with only the first two tags in the tags array?

Exhibit

C100DBA question #22 exhibit

Options

  • Adb.posts.find({author:"Tom"».limit({tags:2})
  • Bdb.posts.find({author:"Tom"».limit($slice:{tags:2>)
  • Ddb.posts.find({author:"Tom">,{tags:{$slice:2»)

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

#$slice#array projection#query projection#array operators
Full C100DBA Practice