Reputation: 1149
Can I query elements of arrays which are inside documents instead of querying whole documents? I. e. I want to receive array elements, not documents. E. g., I have this:
{
blog: 'blog1',
comments:
[{user: 'Alice', text: 'bla-bla-bla'}, {user: 'Sarah', text: 'bla-bla-bla'}, ...]
},
{
blog: 'blog2',
comments:
[{user: 'John', text: 'bla-bla-bla'}, {user: 'Alice', text: 'bla-bla-bla'}, ...]
}
How can I get a list of comments written by Alice?
Upvotes: 0
Views: 107
Reputation: 33145
You can't do this yet. See https://jira.mongodb.org/browse/SERVER-828
Upvotes: 2