瓶-mongoengine聚合 [英] Aggregation in flask-mongoengine
问题描述
我正在使用flask-mongoengine,并试图
$ b $ pre $ class $ MyDocumentModel(db.Document)
name = db.StringField(max_length = 55)
MyDocumentModel.objects.aggregate()
:b
$ b
AttributeError:'BaseQuerySet'对象没有'aggregate'属性
$ b $从mongoengine v0.9(目前正在开发中)开始,你将可以使用 aggregate()
,就像你建议的那样: http://docs.mongoengine。 org / apireference.html#mongoengine.queryset.QuerySet.aggregate
在此之前,您需要依靠 pymongo
: Flask-MongoEngine& PyMongo聚合查询
I'm just staring out with MongoDB and I'm staring an application with flask-mongoengine and I want to aggregate a few documents.
I'm using flask-mongoengine and when trying
class MyDocumentModel(db.Document):
name = db.StringField(max_length=55)
MyDocumentModel.objects.aggregate()
I get the error:
AttributeError: 'BaseQuerySet' object has no attribute 'aggregate'
Starting with mongoengine v0.9 (which is currently in development), you will be able to use aggregate()
, like you suggested: http://docs.mongoengine.org/apireference.html#mongoengine.queryset.QuerySet.aggregate
Until then, you need to rely on pymongo
: Flask-MongoEngine & PyMongo Aggregation Query
这篇关于瓶-mongoengine聚合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!