Hi,
my collection contains of data with a value and a timestamp. The same value can appear multiple times (with different timestamps).
My current indexes are:
Index 1
{
name: "by_time",
unique: false,
serialized: true,
source: "data",
values: [
{
field: ["data", "time"]
},
{
field: ["ref"]
}
]
}
Index 2
{
name: "by_value",
unique: false,
serialized: true,
source: "data",
values: [
{
field: ["data", "value"]
}
]
}
I have a query counting all distinct values by using index 2.
And I have a query counting all values within a time range using index 1.
What I am struggling with is counting all distinct values within a selected time range.
I tried to use intersect and join but could not figure it out.