DEV Community

Agik Setiawan
Agik Setiawan

Posted on

Nested where condition in Mongoose

example data structure

{
    "name":"John",
    "contact":{
        "phone":"123",
        "email":"abc@gmail.com"
    }
}
Enter fullscreen mode Exit fullscreen mode

Where condition example:

this.user.findOne({
"contact.phone": "123"
})
Enter fullscreen mode Exit fullscreen mode

Top comments (0)