Constraints on Decimal Fields Not Working as Expected #83
vaibhavpatankar01
started this conversation in
General
Replies: 2 comments
-
Hi @vaibhavpatankar01, We have resolved the validation issue; the next version will take care of it.n |
Beta Was this translation helpful? Give feedback.
0 replies
-
Install version 0.11.7, which includes the field validation fix. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am encountering an issue with the mongoz library where the constraints specified for Decimal fields are not functioning correctly.
Specifically, I have implemented a MyDocument class with a price field that is intended to enforce maximum digits and decimal places
Expected Behavior
The price field should accept values with a maximum of 5 total digits, including up to 2 digits after the decimal point.
Valid examples:
123.45
12.34
0.99
99.99
Invalid examples should raise an error:
1234.56 (6 total digits)
100.01 (exceeds max digits)
Actual Behavior
Currently, the constraints do not appear to be enforced as documented. For instance, I am able to
specified maximum digits and decimal places without any validation errors.
Steps to Reproduce
Additional Information
Version of mongoz: [0.11.5]
Any help would be greatly appreciated 🙏
Beta Was this translation helpful? Give feedback.
All reactions