Quantcast
Channel: How to query MongoDB with "like" - Stack Overflow
Viewing all articles
Browse latest Browse all 48

Answer by Eddy for How to query MongoDB with "like"?

$
0
0

If using node.js, it says that you can write this:

db.collection.find( { field: /acme.*corp/i } );
//or
db.collection.find( { field: { $regex: 'acme.*corp', $options: 'i' } } );

Also, you can write this:

db.collection.find( { field: new RegExp('acme.*corp', 'i') } );

Viewing all articles
Browse latest Browse all 48

Trending Articles