weaverbird
weaverbird copied to clipboard
Use $literal when needed in Mongo translator
A filter like column "foo" equals "bar" will be translated as {$match: {foo: "bar"}}
.
Likewise, a filter like column "foo" equals "$10" will be translated as {$match: {foo: "$10"}}
. Except that the $10
in mongo will be understood as "the column 10", which probably doesn't exist. We should use the $literal operator where the $
and .
signs should be read without any interpretation.