currently using this
.find({"strings": {"$elemMatch": {"$in": [/test/si]}}})
to find a string in the "strings" array. Now i also need to search this string HERE
.aggregate([
{
$match: {"_id" : ObjectId("5c5c59c689c4cf027b382999") }
},
{ $project: {
data: {
$filter: {
input: '$data',
as: 'item',
cond: {
---------------------------------HERE
}
}
}
}}
])
I already tried a lot of similar things like e.g.:
.aggregate([ {
$match:
{"_id" : ObjectId("5c5c59c689c4cf027b382999") }
},
{ $project: {
data: {
$filter: {
input: '$data',
as: 'item',
cond: { $in: [/test/si, "$$item.strings"] }
}
}
}}
])
I currently can not think about a way how to do this. Is there any way to do this in Version 3.6?
if you can help in any way: thanks
greetings H.M.
I've made a workaround:
But this works really badly without regex and I can not match a
string[]