I have the data in MongoDB like following:
{
_id: ObjectId('xxxxxxxxxxxx'),
data: {
key1: value 1,
key2: value 2,
...
}
...
}
I use Mongoose in Node.js app to connect to MongoDB.
I want to query all objects which the data field contains a certain string i.e: 'apple'
{
data: {
...
key3: 'I'd like to eat apple'
....
}
}
How can I make this kind of query with Mongoose?