I’m terrible at explaining myself. Let me be less vague.
I have this data structure.
{
name: "Whatever",
steps: [
{ time: 0, name: "A" },
{ time: 241, name: "B" },
{time: 250, name: "B" }, // and so on
]
}
I want to search this collection with a given time and set of names, and get models that have steps before the given time, for all of the given names, but no more.
For example, querying time: 300, names:[“A”, “B”]` would return the model above, because it has A and B before 300.
However if I queried time: 300, names:[“A”, “A”, “B”]`, it wouldn’t because it doesn’t have 2 “A” before 300.
I posted an SO question here about it: https://stackoverflow.com/questions/57758786/mongo-query-an-array-of-objects-included-in-a-set