-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.2.3
-
Component/s: None
-
Labels:None
I expect if that if mongo can parse a given `find` query, then mongoexport can parse that query too. Turns out that is not the case: mongoexport expects strict JSON input, with double quotes around all keys.
This works as expected:
mongo ${MONGO_URL} --quiet --eval "db.tweets.find({ _id: '...' })"
This fails with "Failed: error parsing query as Extended JSON: invalid JSON input":
mongoexport --uri=${MONGO_URL} -c tweets -q "{ _id: '...' }"
This makes it extra cumbersome to use mongoexport in shell scripts due to having to escape all the quotes.