If you are familiar with SQL Server or another relation database, the 'LIKE' query look like as below.
SELECT * FROM [dbo.][USERS] WHERE FNAME LIKE '%DILIP%'
In MongoDB, it looks like as below(query in MongoDB console)
db.USERS.find({"FNAME":/DILIP/})
Same as
db.USERS.find({"FNAME":/^DILIP/}) // FNAME LIKE 'DILIP%'
$regex in MongoDB
No comments:
Post a Comment
Please do not enter any spam link in the comment box.