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

Answer by waseem khan for How to query MongoDB with "like"?

$
0
0
  • One way to find the result as with equivalent to like query
db.collection.find({name:{'$regex' : 'string', '$options' : 'i'}})

Where i use for cases insensitive fetch data

  • Another way by which we can get result also
db.collection.find({"name":/aus/}) 

Above will provide the result which have the aus in name cantaing aus.


Viewing all articles
Browse latest Browse all 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>