0

I have document structure like:

{
      "date": "2017-02-28T13:06:05Z",
      "id": "370adb62d5b1461ead2c4d9410710482",
      "json": {
              "flag": true,
              "key": "abc",
              "no":{ 
                    "no1":"one",
                    "no2":"two"
                   }
               }
}

I want to retrive documents where key equals "abc" and no1 equals "one"

Please help !

1
  • Please show us your effort and tell us where you are stuck. So that we can help you out to solve your issue. Commented May 24, 2017 at 12:39

1 Answer 1

2

this should do the trick :

db.collection.find({"json.key": "abc", "json.no.no1": "one"})

try it online: mongoplayground.net/p/XelDmKBa6JS

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.