Nested schema bug on related data

Feature(s) impacted

related data not showing

Observed behavior

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

Expected behavior

forest will recognize any level of nested schemas

Context

  • 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

hello again,

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,
nimrod

Hello @nmz

Before going any further, can you confirm that the data is not showing as a JSON field in the edition form?

hi @anon39940173 ,

as far as i understand ur question. the data is showing as json, thats the problem…
hope that helps

thanks,
nimrod

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.

thanks,
ill check it out

nimrod

hi again,

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.

thanks,
nimrod