Typeschecks inside database queries
Hey how can i check if a particular item is in database array
2 Replies
Hey @pranjal_fxd
We don't have typechecks in the database query language. Your options are:
1. Encode the information along with the multi-typed data. You could store
{type: "array", value: []}
, {type: "string, value "foo"}
documents for example
2. Filter the data in JavaScript/TypeScript after collect()
Let me know if that helpsTo expand on (1), you can also store the different types in different fields
Your type could look like:
You could have an index on "data.string" like:
or fetch the ones of a given type like: