-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bson.errors.InvalidDocument: cannot encode object: Decimal('3.5'), of type: <class 'decimal.Decimal'> #12
Comments
Could you post here all the software versions/system info? |
Do you mean my requirements ?
|
Also version of the mongodb and Python would be handy. |
@barseghyanartur i'm using python3.8.0 and for mongo i'm using an docker container mongo:latest. |
Could you check which "latest" is it? |
mongo version 4.4.5 |
I would like to work on this if it is still relevant. @leonardoarbache Still interested in a solution? |
Yeah I'm still interested. |
I had a similar issue. The problem is with mongoengine not being able to handle decimals inside dicts properly, so I had to do following workaround and use float instead of decimal, which was sufficient for my use case:
And then than use it like this
|
I have the follow document structure:
I declared the badge document as:
I made a filter to filter the DecimalField on the EmbeddedDocument Badge:
I'm trying to do the following request:
But i always receive this error:
I've already tried and observed that:
127.0.0.1:8000/relatorios/?badge_valor=3.5g
)I don't know what i missing or if there's something wrong. Please, HELP!
The text was updated successfully, but these errors were encountered: