Hello,
I would like to seek your assistance regarding a question regarding the use of MongoDB with Meteor. I am looking to use a regular expression (regex) to search for documents within a MongoDB database. However, the particularity of my query is that I wish for this regular expression to be applied to an array of objects within the documents.
Do you have any advice or examples to share on how to implement this search effectively within the scope of my Meteor application?
Thank you in advance for your help.
Best regards,
Collection.find(
{
$and: [
{id: {$regex: new RegExp(requestId, "i")}},
{host: {$regex: new RegExp(host, "i")}},
{uri: {$regex: new RegExp(url, "i")}},
{'messages.id': {$regex: new RegExp(ruleId, "i")}},
{'messages.data': {$regex: new RegExp(data, "i")}},
{'messages.msg': {$regex: new RegExp(message, "i")}},
{'messages.severity': {$regex: new RegExp(severity, "i")}},
]
},
{
limit: 100, skip: (page - 1) * 100,
$orderby: { requestDate : 1 }
},
),
for example messages.severity
doublem