Doing a find() to contain a substring (contains)
burf2000 opened this issue · comments
Simon Burfield commented
Hi there
How would you do the following mongo statement in MongoKitten
db.users.findOne({"username" : {$regex : ".son."}});
This looks for the word "son" in a string
Joannis Orlandos commented
Sorry, we've missed this issue. If anyone wonders: You need to create a BSON RegularExpression
object, or use the static helper functions on Query
.