Here is the table structure:
"products": [
{
"reviews": [],
"_id": "5ece6d09cab302507c5d147e",
"category": {
"_id": "5ece6c07cab302507c5d1478",
"type": "Marketing",
=
I need to retrieve all products with the category type 'Marketing'.
This is how I tried it:
let products = await Product.find({ 'category': '5ece6c07cab302507c5d1478' })
However, I prefer not to use the ID for the search but rather the word "Marketing".
The following query didn't return any results:
let products = await Product.find({ 'category.type': 'Marketing' })
Any assistance would be greatly appreciated.