Say you have a blog collection like this
{"title": "Post Title", "body": "Post Body", "comments": [{"user": "user1", "comment": "comment from user1"}, {"user": "user2", "comment": "comment from user2"}]}
{"title": "Post Title 2", "body": "Post Body 2", "comments": [{"user": "user1", "comment": "comment from user1"}]}
How can I query for the comments from a user?
This query works but returns comments from user2 as well as user1.
db.posts.find({"comments.user": "user1"})
Is there any way to get only the comments from user1?