Open harshalizode opened 4 days ago
I will have a look but please give me an example of something you are trying to store to run against
I am firing the query as
await Achived.objects.create(score_from=0.60, score_to='0.90', amount='78.6786')
But it causing the error if I convert the decimal values in the decimal.Decimal
object then it requires the type string, integer or float.
@harshalizode correct, Pymongo doesn't understand the native Decimal, for some reason they didn't do an internal implementation. So they use a Decimal128, which is now being supported internally by the version 0.10.1.
If you install that one, this issue should be now fixed.
The docs were also updated with some extra explanations, but the way you do remains the same 👍🏼
@harshalizode something for the embedded documents was missing from release 0.10.1 for the decimal as well, now it is updated in the 0.10.2, apologies for that.
Yes, It has been solved in the latest version. Thank you.
Hello,
I am trying to store the decimal value in by embedded document:
When I try to store the decimal value it raise the exception as:
InvalidDocument("cannot encode object: Decimal('0.60'), of type: <class 'decimal.Decimal'>")
. As I passing the string or float value for it to store in document.