0

I have a collection of movies, and the movie collection has an embedded document array of reviews. I want to select all the reviews with status=1

{
  reviews: [
    {
      status: 0,
      text: 'hello'
    }, {
      status: 1,
      text: 'hi'
    }
}, {
    ... etc ...
Community
  • 1
  • 1
Robert Martin
  • 16,759
  • 15
  • 61
  • 87

1 Answers1

0

There's an answer to the same question: Filtering embedded documents in MongoDB

In current stable version of mongodb it's still no way to do embedded document filtering.

In 2.1.0 there is aggregation. You can filter reviews using unwind and match

Not tried myself, though.

Community
  • 1
  • 1
daeq
  • 1,161
  • 9
  • 6