|
@@ -46,8 +46,8 @@ class OrderService extends CrudService {
|
|
|
];
|
|
|
pipeline.push(...step2);
|
|
|
pipeline.push({ $unwind: '$data' });
|
|
|
- pipeline.push({ $match: { customer } });
|
|
|
pipeline.push({ $replaceRoot: { newRoot: '$data' } });
|
|
|
+ pipeline.push({ $match: { customer } });
|
|
|
const qp = _.cloneDeep(pipeline);
|
|
|
qp.push({ $sort: { 'meta.createdAt': -1 } });
|
|
|
if (skip && limit) qp.push({ $skip: parseInt(skip) }, { $limit: parseInt(limit) });
|