|
@@ -16,16 +16,15 @@ class PatentnoticeService extends CrudService {
|
|
|
}
|
|
|
|
|
|
async query(query, { skip = 0, limit = 0 } = {}) {
|
|
|
- query = await this.resetQuery(query);
|
|
|
- console.log(query);
|
|
|
- const data = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
|
|
|
+ const nq = await this.resetQuery(_.cloneDeep(query));
|
|
|
+ const data = await this.model.find(nq).skip(parseInt(skip)).limit(parseInt(limit))
|
|
|
.sort({ 'meta.createdAt': -1 });
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
async count(query) {
|
|
|
- query = await this.resetQuery(query);
|
|
|
- const res = await this.model.countDocuments(trimData(query)).exec();
|
|
|
+ const nq = await this.resetQuery(_.cloneDeep(query));
|
|
|
+ const res = await this.model.count(nq);
|
|
|
return res;
|
|
|
}
|
|
|
|