I think it's just a mistake try.mongodb.org. They work for me in the local local shell mongo:
db.people.find({first_name: {$regex: /e/}})
db.people.find({first_name: /e/})
And the documentation says this :
You can use regular expressions in database query expressions:
db.customers.find( { name : /acme.*corp/i } );
db.customers.find( { name : { $regex : 'acme.*corp', $options: 'i' } } );
[...]
db.customers.find( { name : { $regex : /acme.*corp/i, $nin : ['acmeblahcorp'] } } );
Thus, both string and regression versions of RegExp are supported.
source
share