Or query of mongo

about the or query items of mongodb, please refer to the following:
Sql method axi`and baked query x" or (c in (3 or (c in (2)
mongo shows the result of first querying c in (3J 2) and then related Filter.
is there something wrong with my writing, or is it that mongo itself doesn"t support it?

the way I write it now is:

db.getCollection("vip_gindex").find({
    "status": 1,
    $or: [{
        "id": {
            $in: [305898, 433975]
        }
    }]
})

as a result, only two items were investigated and dealt with

Mar.28,2021

db.getCollection ('vip_gindex'). Find ({' $or': [{'$and': [{'ajar or': x}, {' bounded or': x}]}, {'$and': [{'and':: {' in': [3]]}}]})


what you mean is:

status = 1 AND id IN (305898, 433975)

$or doesn't really mean anything, because each element in the array that follows $or is a condition, and you only give one element.
press what you want

a='x' AND b='x' OR ( c IN (3,2) )

should be:

    db.getCollection('vip_gindex').find({
        $or: [{
            a: 'x',
            b: 'x'
        }, {
            c: {
                $in: [3, 2]
            }
        }]
    });

it's not wrong to write upstairs, but it's complicated.

Menu