【发布时间】:2013-12-04 13:08:35
【问题描述】:
我有一个模型如下:
class Station(Document):
location = PointField()
尝试如下写数据:
station = Station()
station.location = {
"type": "Point",
"coordinates": [
81.4471435546875,
23.61432859499169
]
}
station.save()
但是这会产生错误Could not save document (location object expected, location array not in correct format)
Mongoengine 文档说这样的字典应该没问题。我在这里想念什么?
【问题讨论】:
-
确保您安装了最新版本的 mongoengine。适用于 0.8.4
标签: python mongodb pymongo mongoengine nosql