like query in mongoose code example
Example 1: How i can use “LIKE” operator in mongoose
// Using MongooseJS
var name="john";
UserSchema.find({name: { $regex: '.*' + name + '.*' } }).limit(5);
Example 2: How i can use “LIKE” operator in mongoose
// Using MongoDB Driver
var colName="v";
models.customer.find({ "abc": { $regex: '.*' + colName + '.*' } },
function(err,data){
console.log('data',data);
});