Feature(s) impacted
Editing a field in a child collection does not apply
Failure Logs
- Agent technology: NodeJS (Express)
- Agent (forest package) name & version: forest-express-mongoose (9.3.17)
- Database type: MongoDB, Mongoose
Context
Since yesterday, when I edit my vauto
field from forest, the change isn’t taken into account. No changes have been made on our end that would explain why it suddenly stops working. After several tests, it seems that it doesn’t work when I edit child schemas. (I hope I’m making myself clear!).
The main structure is Store
. I am trying to modify a store. Here’s my data structure:
const StoreSchema = new mongoose.Schema(
{
name: { type: String, required: true },
vauto: { type: VAutoSchema, required: false },
exampleSchema: { type: ExampleSchema, required: false },
exampleObject: {
email: String,
name: String
},
}
)
const VAutoSchema = new mongoose.Schema(
{
username: { type: String },
entity: { type: String },
skipLeads: { type: Boolean, default: false },
pushOnDemand: { type: Boolean, default: false }
},
{ _id: false }
)
If I edit vauto
or exampleSchema
(which doesn’t exist, but that’s just so you understand), then no changes will be made. However, editing exampleObject
will work.
My API has middleware when forest modifies fields, and when I edit vauto
, I get nothing:
[Forest] storeCreateOrUpdateMiddleware: {
"data": {
"id": "xxxx",
"attributes": {},
"relationships": {
"group": {
"data": {
"type": "xxx",
"id": xxxx""
}
}
},
"type": "Stores"
}
}
But if I modify exampleObject
I will have the values in attributes
.
From what I remember, we didn’t have this problem before. Has anything changed? And if not, what would the workaround be?
Thank you very much!