node.js - Query aggregate match with filters specified in document -
node.js - Query aggregate match with filters specified in document -
i have document this:
{ "name" : "henrik", "info" : { "phone" : "040*" } }
the input query url?phone=040123456
var query = req.query; db.people.aggregate([{ $match : { "info.phone" : query['url'] // match 040* } }])
in case want match input filter defined in database.
is possible?
node.js mongodb
Comments
Post a Comment