MongoDB - Regular Expression
In MongoDB if we need to find record with certain pattern, then we can use regular expression. It is also "like" query in SQL.
e.g. If we want to find user email matching with "findnerd.com" pattern.
db.collection.find({email: new RegExp('.*@findnerd.com')})
Above query return all email ids with ending with @findnerd.com.
0 Comment(s)