how to query a nested document in mongo

74 Views Asked by At

My document structure is as below

  "options" : {
    "fruit" : {
      "is" : false,
    }
    "vegetable" :{
     "is":true,
    }
  }

I want to pick up all basket items which are vegetable ONLY

I tried

{"options.vegetable.is":"true"} //not working
{"options":"vegetable"} // not working

I am using MongoVUE and trying with $eleMatch but still getting the syntax error..

0

There are 0 best solutions below