Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to query mongodb with like

db.users.find({"name": /m/})
or
db.users.find({"name": /.*m.*/})

You're looking for something that contains "m" somewhere
(SQL's '%' operator is equivalent to Regexp's '.*'), 
not something that has "m" anchored to the beginning of the string.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #query #mongodb
ADD COMMENT
Topic
Name
2+8 =