{
type: "item",
id: 1,
name: "test item",
specs: [100, 200, 300],
...
}
{
type: "spec",
id: 100,
name: "test spec",
description: "test spec description",
...
}
There are about 50000 documents of type item and about 2000 documents of type spec. We don’t want to keep full details of spec in the item documents to minimize db size. So we are keeping only the spec ids in item documents.
We need to retrieve items which have a spec named ‘something’. Is there a way to join documents and write a query to get the results for this scenario.