I have a document with property is an array like:
{
name: ['Clark', 'Memphe', 'Alberto', 'Traicl']
}
I want query with keyword = 'cl' and I purpose the return will be
['Clark', 'Traicl']
How I can query with this conditions?
Try this query
db.collection.find({"name": /.*cl.*/})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With