like mongodb
db.users.find({"name": /.*m.*/});
db.users.find({"name": /m/});
Items.find({"description": {$regex: ".*" + variable + ".*"}}).fetch();
5
1
db.users.find({"name": /.*m.*/})
Thank you!
1
0
3
1
db.users.find({"name": /.*m.*/})
Thank you!
1
0
4.2
5
Thank you!
5
0
3.83
6
db.users.find({"name": /m/})
Thank you!
6
0
3.9
10
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.
Thank you!
10
0
4.25
4
db.collection.find( { "url": { "$regex": ".*a.*"} } );
Thank you!
4
0
0
0
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.
Thank you!
0
0
Are there any code examples left?
New code examples in category Shell/Bash