|
@@ -1,7 +1,7 @@
|
|
|
import { ReturnModelType } from '@typegoose/typegoose';
|
|
|
import { AnyParamConstructor } from '@typegoose/typegoose/lib/types';
|
|
|
import { Application, Context } from '@midwayjs/koa';
|
|
|
-import { cloneDeep, get } from 'lodash';
|
|
|
+import { cloneDeep, get, omit } from 'lodash';
|
|
|
import { PageOptions, ResultOptions } from './Options';
|
|
|
import { PopulateOptions } from 'mongoose';
|
|
|
import { App, Inject } from '@midwayjs/core';
|
|
@@ -97,6 +97,7 @@ export abstract class BaseService<T extends AnyParamConstructor<any>> {
|
|
|
if (filterKeys.length <= 0) throw new ServiceError(ErrorCode.NEED_PARAMS);
|
|
|
const num = await this.model.count(filter);
|
|
|
if (num <= 0) throw new ServiceError(ErrorCode.DATA_NOT_FOUND);
|
|
|
+ body = omit(body, ['meta'])
|
|
|
await this.model.updateMany(filter, body);
|
|
|
}
|
|
|
|