MongoDB allowDiskUse not working..

后端 未结 3 1203
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-05 14:55

Experts.

I\'m new to MongoDB, but know enough to get my self in trouble.. case in point:

db.test.aggregate(
[
    {$group: {_id: {email: \"$email\", ge         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 15:20

    If you are working with m10 or later version of MongoDB Atlas, below is the fix for {allowDiskUse: true}; If you are accessing data from application via mongoose then, it should be syntax as function. For example:

    MongoDb Query:

    db.collection.user.aggregate([], {allowDiskUse: true})
    

    With Mongoose:

    User.aggregate([]).allowDiskUse(true);
    

    This will resolve error from application :)

提交回复
热议问题