It would be convenient if multiple filters could be applied at once (i.e. use an array of filters). Constructing select is also a bit awkward Currently I have to do this:
let query = cube.query();
for (const f of filters) {
query = query.filter(f);
}
While for .select(), I need an object (with a concrete Component):
for (const [key, iri] of fields) {
query = query.select({
[key]: [...measures, ...dimensions].find(m => m.iri.value === iri)!
});
}
// and then:
await query.execute()
An improved API for the case where we have a list of fields to select and filters would be
cube.query()
.select([["foo", dimFoo], ["bar", dimBar]]) // Similar to new Map(...)
.filter([dimFoo.equals("baz")])
It would be convenient if multiple filters could be applied at once (i.e. use an array of filters). Constructing select is also a bit awkward Currently I have to do this:
While for
.select()
, I need an object (with a concrete Component):An improved API for the case where we have a list of fields to select and filters would be