how to use mongodb aggregate and retrieve entire documents

后端 未结 5 2071
猫巷女王i
猫巷女王i 2021-01-11 10:53

I am seriously baffled by mongodb\'s aggregate function. All I want is to find the newest document in my collection. Let\'s say each record has a field \"created\"



        
5条回答
  •  南方客
    南方客 (楼主)
    2021-01-11 11:50

    In the documentation i found that the $$ROOT expression addresses this problem.

    From the DOC: http://docs.mongodb.org/manual/reference/operator/aggregation/group/#group-documents-by-author

提交回复
热议问题