0 votes
in MongoDB by
edited by
Consider a collection posts which has fields: _id, post_text, post_author, post_timestamp, post_tags etc. Which statement query retrieves ONLY the key named post_text from the first document retrieved?

A - db.posts.find({},{_id:0, post_text:1})

B - db.posts.findOne({post_text:1})

C - db.posts.finOne({},{post_text:1})

D - db.posts.finOne({},{_id:0, post_text:1})

1 Answer

0 votes
by
edited by

Ans is 

D - db.posts.finOne({},{_id:0, post_text:1})

...