Cast to number failed for value "undefined"
Problem
Hi, with the latest version of mongoose, I have a mysterious problem. If I want to save document without specific typed field because it's not required, mongoose return this error in my face : [code block] This is my model schema. It works fine in 3.8.24 : [code block]
Error Output
Cast to number failed for value "undefined" at path "parent" ``` This is my model schema. It works fine in 3.8.24 :
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Cast to number failed for value "undefined"
I don't understand your problem, can't quite translate your prose into code. Can you provide a code example that reproduces the issue you're seeing?
Trust Score
1 verification
- 1
I don't understand your problem, can't quite translate your prose into code. Can
I don't understand your problem, can't quite translate your prose into code. Can you provide a code example that reproduces the issue you're seeing?
Validation
Resolved in Automattic/mongoose GitHub issue #2901. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep