Hi, I got this error when trying to update a simple array in nested sub documents.
I investigated the error log and inspect the data, seems likeFA is trying to stringify a complex object here
Feature(s) impacted
embedded-relationship-updater
Observed behavior
Error in console prevents save action:
Uncaught (in promise) TypeError: Converting circular structure to JSON
→ starting at object with constructor ‘e’
Expected behavior
The update succeeds
Failure Logs
Context
I have an Event model defined in mongoose like this
class Event {
@prop({ _id: true, type: BroadcastRoom })
broadcast_rooms?: BroadcastRoom;
}
and BroadcastRoom is defined like this
class BroadcastRoom {
@prop({type: String})
tags?: Types.Array
}
This is what I have in .forestadmin-schema.json
....other fields of Event
}, {
"field": "broadcast_rooms",
"type": [{
"fields": [
...other fields of BroadcastRoom,
"field": "tags",
"type": ["String"]
}, {
- Agent (forest package) name & version: “forest-express-mongoose”: “^9.3.2”,
- Database type: “mongodb”: “^5.7.0”, “mongoose”: “^7.4.1”,
- Project: lemonade-local
- Environment: Development