I'd like to search my database for Customers that start with FOO or have FOO in their names. For that i took a look at this question -> How to query MongoDB with "like"?
After that i build my query so that it looks like this ->
Customer.find({'name': '/FOO/'}).exec(function (err, customer) {
console.log(customer);
})
but although there is a customer with FOO inside the 'name'
i get no result. If i modify my query to ...({'name': 'FOO'})...
instead of ...({'name': '/FOO/'})...
i get my customer. What am i doing wrong?