Use regex query with mongoexport

239 Views Asked by At

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

mongoexport --quiet --assertExists --jsonArray --pretty --collection='users' --query='{"email": {$regex: /^[email protected]$/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: /^[email protected]$/i}})

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

0

There are 0 best solutions below