We’re migrating from forest-express-sequelize
to @forestadmin/agent
.
Need help replacing search operator on a JSON column.
Previously we had this in the collection fields:
We can’t use flatteners because as specified in the see docs, the flattened fields can’t be searched/filtered on.
We then would need to use replaceSearch
, but we haven’t found a way to make it look into the wanted attributes of the json column directly: it would be really helpful if we could specify as “field” (under conditions) the attribute in the json column, but we can only specify proper fields and relationships.
One workaround could be to first make a query to get the records matching the logic we want and then return it in an “or” condition with the default search, but this would mean we are making double the queries for each search.
How can we achieve the same result we had before?
Thank you,
Matteo
Here is the “meta” section of the forest admin schema file:
{
"liana": "forest-nodejs-agent",
"liana_version": "1.41.7",
"liana_features": null,
"stack": {"engine": "nodejs", "engine_version": "20.11.1"}
}
and from package.json
:
"sequelize": "^6.28.0"