Feature(s) impacted
Nested fields
Observed behavior
I have an object with a nested field. The nested field is defined as an enum in Mongoose.
When I display that field in Forest Admin, the field is of type String (see attached picture).
Is there no way to keep nested fields as enums? If I flatten only this one field, I get an error when updating that field + any other from the nested object, as the datasource’s unflattenRecord(patch, asFields, patchMode=true) turns the flattened key into a dotted key, producing a single updateOne patch of:
{ dmsIdentifier: {storeId: …}, "dmsIdentifier.type": "xxx" }
which MongoDB does not accept.
Expected behavior
Nested fields should be enums. This used to work fine in `forest-express-mongoose`
Context
- Project name: AutoHub
- Team name: …
- Environment name: AutoHub
- Database type: MongoDb
- Recent changes made on your end if any: Upgrade from
forest-express-mongooseto@forestadmin/agent
And, if you are self-hosting your agent:
-
Agent technology: NodeJS
-
Agent (forest package) name & version (from your .lock file):
“@forestadmin/agent”: “^1.79.5”,"@forestadmin/datasource-mongoose": "^1.13.4",
