UNPKG

@joktec/mongo

Version:

JokTec - Mongo Service

22 lines 1.5 kB
import { ICondition, INear } from '@joktec/core'; import { types } from '@typegoose/typegoose'; import { QueryWithHelpers, UpdateWriteOpResult } from 'mongoose'; import { ParanoidQueryOptions } from '../plugins'; export interface QueryHelper<T> { search: types.AsQueryMethod<typeof search<T>>; center: types.AsQueryMethod<typeof center<T>>; destroyOne: types.AsQueryMethod<typeof destroyOne<T>>; destroyMany: types.AsQueryMethod<typeof destroyMany<T>>; restore: types.AsQueryMethod<typeof restore<T>>; } declare function search<T>(this: types.QueryHelperThis<any, QueryHelper<T>>, keyword?: string): types.QueryHelperThis<any, QueryHelper<T>, any>; declare function center<T>(this: types.QueryHelperThis<any, QueryHelper<T>>, near?: INear): types.QueryHelperThis<any, QueryHelper<T>, any>; declare function destroyOne<T>(this: types.QueryHelperThis<any, QueryHelper<T>>, filter?: ICondition<T>, options?: ParanoidQueryOptions<T>): QueryWithHelpers<T, T>; declare function destroyMany<T>(this: types.QueryHelperThis<any, QueryHelper<T>>, filter?: ICondition<T>, options?: ParanoidQueryOptions<T>): QueryWithHelpers<{ acknowledged: boolean; deletedCount: number; } | UpdateWriteOpResult, any>; declare function restore<T>(this: types.QueryHelperThis<any, QueryHelper<T>>, filter?: ICondition<T>, options?: ParanoidQueryOptions<T>): QueryWithHelpers<T, T>; export declare function buildQueryMethod(): ClassDecorator[]; export {}; //# sourceMappingURL=mongo.method.d.ts.map