MongoEngine 中的 Document 类似乎没有“to_bson”函数:
from mongoengine import *
class MyDoc(Document):
foo = StringField()
bar = IntField()
doc = MyDoc.objects.create(foo=u"Hello World")
print "Document BSON length is:", len(doc.to_bson()) # fails : no "to_bson"
有什么解决办法吗?