related data not showing
when adding a new collection, forest automatically adds array of objects to related data segment,
if there is more than one level of nested schemas, schema within schema, the array doesnt show at all
forest will recognize any level of nested schemas
- Project name: WescoverContentAdmin
- Team name: Operators
- Environment name: Development | nimrodmaltz
- Agent type & version: “forest-express-mongoose”: “8.7.6”
- Recent changes made on your end if any: added collection
im having an issue with related data segment, when there is more than one level of schema, the related data doesnt recognize the array, i think this is a bug. if i use only one schema it works but if i use a schema declared within a schema it breaks, no errors.
thanks in advance,
Before going any further, can you confirm that the data is not showing as a JSON field in the edition form?
hi @romaing ,
as far as i understand ur question. the data is showing as json, thats the problem…
hope that helps
Sadly forest-express-mongoose does only support one level of nested lists.
There are no easy solutions to your issue, but:
By keeping your actual project written with
forest-express-mongoose, and depending on your data structure, you may be able to find a way out using
smart fields and the
field flattener, but this was not designed to work with arrays so YMMV.
However, if you are willing to upgrade, we have written a new agent in TypeScript that supports connecting to mongoose databases.
- It is still in beta (for a couple weeks at maximum), but is already the default for projects onboarding in forest admin with Mongoose since July 5th (don’t choose “MongoDB”, those projects still onboard with the former agent).
- Among many other things, the new agent allows splitting a single mongoose model into as many forest admin models as needed, which should allow to do what you are trying to achieve.
Don’t hesitate to try it out by setting up a new test project (feedback is welcome) and coming back to us.
just to make sure u understand, the problem is not with nested lists. it works fine as nested lists.
the problem is with using schema as the type. when using more than one level of schema, the related data breaks. its probably related to this issue but still not the same.