Here is Query in mongodb , where i used to get information on the basis of status, verify_status and their category as well as their Location, their is only one location for the field but need to find in multiple set of location.
Update : I try to run this query in Robo3t , it return blank Result but same query i run in Studio3t it shows expected Result. is there any version issue.
{
"status":{
"$eq":"Active"
},
"verify_status":{
"$eq":"Yes"
},
"$or":[
{
"category":{
"$eq":{
"$oid": "5da0f71e15712b5f7723bb58"
}
}
},
{
"multi_car_status":{
"$eq":"ON"
},
"additional_category":{
"$eq": "5da0f71e15712b5f7723bb58"
}
}
],
"driver_location":{
"$in":[
"5dee787f15712b443f6a5e06",
"5dee787f15712b443f6a5e06"
]
}
}
When i removed the driver_location or "$or" its return resul.there are result in the db but it return return 0 result. i can't get the result with the both the operators. below is the sample data.
{
"_id" : ObjectId("5ead0f5f15712b5df22d7e23"),
"driver_location" : "5dee787f15712b443f6a5e06",
"category" : ObjectId("5da0f71e15712b5f7723bb58"),
"image" : "7f8e1ddfbe862a7ac4386b2f41fe953f.jpg",
"driver_name" : "Ravi aa",
"email" : "#####@gmail.com",
"dail_code" : "+1",
"mobile_number" : "83748746",
"dob" : "10/05/2000",
"password" : "######",
"verify_status" : "Yes",
"status" : "Active",
"availability" : "Yes",
"mode" : "Available",
"gender" : "male",
"vehicle_type" : null,
"vehicle_maker" : "5da0f05115712b5fb36e3d02",
"vehicle_model" : "5db22e1215712b25a36b8a3c",
"loc" : {
"lon" : 77.35124777,
"lat" : 28.6543715
},
"address" : {
"address" : "delhi",
"county" : "United States",
"state" : "AR",
"city" : "delhi",
"postal_code" : "122001"
},
"multi_car_status" : "ON",
"additional_category" : [
"5da09ed315712b413333ca58",
"5da0f6fc15712b5c1956eed6",
"5da0f73b15712b5fb36e3d09"
],
}