Answers for "mongodb search on multiple fields query"

Go
0

mongodb match multiple fields

$match:
{
	$and: [
    {'ExtraFields.value': {$in: ["A52A2A"]}}, 
    {'ExtraFields.fieldID': ObjectId("5535627631efa0843554b0ea")}
    ]
}
Posted by: Guest on July-01-2020
0

search with multiple field in node js mongodb

db.test.find({
$or:[
    {
        $and: [
                {'stocknumber':12346},
                {'model':'bmx'},
                {'make':2002},
                {'rego':'KA01HG6268'},
                {'adate':'2017-10-01T05:07:10.969Z'},
                {'cdate':'2017-10-01T05:07:10.969Z'}
            ]
    },
    {
        $and: [
                {'stocknumber':12347},
                {'model':'bmy'},
                {'make':2003}
            ]

    }
]
}).pretty()
Posted by: Guest on July-29-2020

Code answers related to "mongodb search on multiple fields query"

Browse Popular Code Answers by Language