I have a collection called products
with the following items
[
{
name: 'Product 1'
images: ['http://staging.example.com/1', 'http://production.example.com/2'],
...
},
{
name: 'Product 2'
images: ['http://production.example.com/3'],
...
}
]
I want to find documents that contain string staging
in the images
array.
I tried couple of things like using $contains but mongo throws error saying I cannot use $contains with array.