【发布时间】:2017-11-01 04:26:36
【问题描述】:
我正在使用 mongodb 3.4 向我的数据库中插入适当的价格..
根据:
https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst#reading-from-extended-json
我在我的 python 代码中使用了这个:
'credits': {'$numberDecimal': Decimal128('9.99')},
但抛出:
bson.errors.InvalidDocument: key '$numberDecimal' must not start with '$'
那么在 mongodb 中使用 python 插入 numberdecimal 的正确语法是什么?
感谢和问候
【问题讨论】:
标签: python mongodb numbers decimal pymongo