Is the query method in the Storage API broken right now?

Hello,

While trying to write a forge app right now (and using forge tunnel), I use storage, query to bulk load some our things, also with a suitable startsWith condition - exactly as has been depicted in the documentation. However, I get the whole contents of the store - that is also kev/value pairs where the key starts not with the condition! Is this feature currently known to be broken? If not, where could I raise a bug report?

Cheers,
Eckhard

Hi @EckhardMaass , storage queries are working fine for us. Maybe you can share your query code. Here’s an example of how we are querying a list of status records that start with a common key:

  const { results } = await storage
    .query()
    .where('key', startsWith(key))
    .limit(Math.min(20, maxOps))
    .getMany()
  const opStatusList = results.map((r) => r.value)
1 Like

Hello,

Quite similar … but I have found the culprit: we use and iterate over a cursor that missed the condition and yielded this bogus results… I wished the API for that would be less convoluted and harder to get wrong as we apparently did: if I have a reference for the cursor it seems really weird to repeat all original arguments, the identifier should be enough, really.

Thanks for your input anyway!

Cheers,
Eckhard

Right, it’s more of a position indicator than a database cursor. It’s interesting that it even works at all with a different query than it was generated from.