Currently the set of allowed operators is fixed in code, which makes sense to avoid unwanted surprises in new versions of MongoDB, but makes the process of including new operators rather rigid.
For example, I now wanted to experiment with the $expr operator, but I don't have any aggregation operator available. The $eq operator is missing too.
I propose to include eq in the set of operators allowed (I assume it's just a forgetfulness), and also add a configuration called MONGO_QUERY_WHITELIST, where one can add all the extra operators needed.
What do you think?
I'll push a PR later
Currently the set of allowed operators is fixed in code, which makes sense to avoid unwanted surprises in new versions of MongoDB, but makes the process of including new operators rather rigid.
For example, I now wanted to experiment with the
$exproperator, but I don't have any aggregation operator available. The$eqoperator is missing too.I propose to include
eqin the set of operators allowed (I assume it's just a forgetfulness), and also add a configuration calledMONGO_QUERY_WHITELIST, where one can add all the extra operators needed.What do you think?
I'll push a PR later