小智 6
您可以将聚合与管道一起使用。像这样:
exports = function(arg){
const mongodb = context.services.get("mongodb-atlas");
const coll = mongodb.db(<dbname>).collection(<collectionname>);
const pipeline = [
{ "$skip" : 1 },
{ "$limit": 20 }
];
return coll
.aggregate(pipeline)
.toArray();
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
309 次 |
| 最近记录: |