CastError: Cast to Embedded failed for value
See original GitHub issueUpgrading to 4.6.2 is causing an error to be thrown:
CastError: Cast to Embedded failed for value "{ label: 'DEFAULT LABEL',
token: '',
_id: 'r1LxVo1gA' }" at path "childSchemaKey" at MongooseError.CastError
We have a schema that used the the above schema { label, token, id } as a child under they key ‘childSchemaKey’. 4.6.1 and prior does not throw any errors.
Any idea what is causing this?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
MongooseError: Cast to embedded failed for value
To make this work, we have to change the type of the productId from Number to String. So, if you're receiving an cast...
Read more >Cast to embedded failed for value "{ value: 'x' }" at path "items ...
After updating to Mongoose 5.11.13 I am getting the following error when trying to add an item to a sub-object inside a document....
Read more >Cast error inserting array (embedded documents) using ...
Cast error inserting array (embedded documents) using Mongoose? ... "message": "Cast to undefined_method failed for value \"[object Object],[object ...
Read more >Node.js – MongooseError: Cast to embedded failed for value
Node.js – MongooseError: Cast to embedded failed for value. mongodbmongoosenode.js. I'm creating a mongoose Schema but I'm getting a MongooseError .
Read more >CastError: Cast to Number failed for value "undefined" (type ...
... i got this mongodb error CastError: Cast to Number failed for value “undefined” (type string) at path i could not find how...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like the embedded value is a string not an object @sandeepaboutclinic . Check
typeof doc.address
before saving.@hirengevariya please don’t double post