i have document in Test collection as given below:
{
"_id" : "3233123123213123123",
"sequence":30,
"containIds":["fgx"]
}
{
"_id" : "534545345345345345",
"sequence":70,
"containIds":["abc", "fgx"]
}
{
"_id" : "56756676767676767",
"sequence":160,
"containIds":[]
}
db.getCollection('Test').find({"containIds":{$in: [ "fgx", "containIds" ]}}).count(); // result 1
and
db.getCollection(Test').count({sequence:{ $gt : 0, $lt : 99}})//result 2
but i want to combine both query in one and need to get a result. //result should be 1
do i need to aggregate and project? how to write query for both using $in and ($gt and $lt) in mongodb?