orlandos-nl / MongoKitten

Native MongoDB driver for Swift, written in Swift

Home Page:https://orlandos.nl/docs/mongokitten/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doing a find() to contain a substring (contains)

burf2000 opened this issue · comments

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

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.