我想克隆一个聚合对象的副本来执行两种类型的查询。我的示例代码如下
const aggregation = db.users.aggregate().match(query);
// From there I want to split this into 2 clone object.
// Suppose there was a .clone function
const aggregation1 = aggregation.clone().count('total');
const aggregation2 = aggregation.clone().skip(skip).limit(limit);
Promise.all([aggregation1.exec(), aggregation2.exec()]);
我该如何实现?感谢您的帮助,谢谢。