mongodb find like
db.users.find({"name": /.*m.*/});
db.users.find({"name": /m/});
Items.find({"description": {$regex: ".*" + variable + ".*"}}).fetch();
mongodb find like
db.users.find({"name": /.*m.*/});
db.users.find({"name": /m/});
Items.find({"description": {$regex: ".*" + variable + ".*"}}).fetch();
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.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us