Use regex query with mongoexport

Viewed 79

I'm trying to export user datas filtered by case insensitive query :

mongoexport --quiet --assertExists --jsonArray --pretty --collection='users' --query='{"email": {$regex: /^john.doe@gmail.com$/i}}' --uri='mongodb://dbhost:27017/mydatabase'

But this command returns nothing.

If I use the same query in mongo shell, it works !

db.users.find({"email": {$regex: /^john.doe@gmail.com$/i}})

I can't explain why. Is anybody can help me ?

0 Answers
Related