PdfPrep.com

Which of the following query retrieves ONLY the key named post_text from the first document retrieved?

Consider a collection posts which has fields: Jd, post_text, post_author, post_timestamp, post_tags etc.

Which of the following query retrieves ONLY the key named post_text from the first document retrieved?
A . db.posts.finOne({},{_id:0, post_text:1})
B . db.posts.findOne({post_text: 1})
C . db.posts.find({},{_id:Of post_text:1})
D . db.posts.finOneĀ«},{post_text:l})

Answer: A

Exit mobile version