RepositoryStorageMethods
Interface: RepositoryStorageMethods
Defined in: packages/models/src/repositories/hooks.ts:45
Static repository operations supplied by the storage mixin.
Methods
aggregate()
aggregate<
T,G,M>(this,spec,params?):Promise<AggregationResult<AggregatedRow<InstanceType<T>,G,M>>>
Defined in: packages/models/src/repositories/hooks.ts:89
Perform aggregate
Type Parameters
T
T extends ModelClass<Storable<any, any>>
G
G extends readonly _NonFunctionPropertyPaths<InstanceType<T>>[] = []
M
M extends Record<string, MetricSpec<InstanceType<T>>> = Record<string, MetricSpec<InstanceType<T>>>
Parameters
this
T
spec
AggregationSpec<InstanceType<T>, G, M>
params?
QueryParameters
Returns
Promise<AggregationResult<AggregatedRow<InstanceType<T>, G, M>>>
count()
count<
T>(this,filter?,params?,options?):Promise<CountResult>
Defined in: packages/models/src/repositories/hooks.ts:101
Count operation
Type Parameters
T
T extends ModelClass<Storable<any, any>>
Parameters
this
T
filter?
WebdaQLString<InstanceType<T>>
params?
QueryParameters
options?
Returns
Promise<CountResult>
create()
create<
T>(this,data,save?):Promise<InstanceType<T>>
Defined in: packages/models/src/repositories/hooks.ts:53
Create operation
Type Parameters
T
T extends ModelClass<Storable<any, any>>
Parameters
this
T
data
Helpers<InstanceType<T>>
save?
boolean
Returns
Promise<InstanceType<T>>
getRepository()
getRepository<
T>(this):Repository<T>
Defined in: packages/models/src/repositories/hooks.ts:49
Get the repository
Type Parameters
T
T extends ModelClass<Storable<any, any>>
Parameters
this
T
Returns
Repository<T>
iterate()
Call Signature
iterate<
T>(this,query,params?):AsyncGenerator<InstanceType<T>,any,any>
Defined in: packages/models/src/repositories/hooks.ts:73
Perform iterate
Type Parameters
T
T extends ModelClass<Storable<any, any>>
Parameters
this
T
query
WebdaQLString<InstanceType<T>>
params?
QueryParameters
Returns
AsyncGenerator<InstanceType<T>, any, any>
Call Signature
iterate<
T>(this,filter,options?):AsyncGenerator<InstanceType<T>,any,any>
Defined in: packages/models/src/repositories/hooks.ts:81
Perform iterate
Type Parameters
T
T extends ModelClass<Storable<any, any>>
Parameters
this
T
filter
ModelFilter<InstanceType<T>>
options?
Pick<FindOptions<InstanceType<T>>, "orderBy">
Returns
AsyncGenerator<InstanceType<T>, any, any>
query()
Call Signature
query<
T>(this,query,params?):Promise<{continuationToken?:string;results:InstanceType<T>[]; }>
Defined in: packages/models/src/repositories/hooks.ts:57
Query operation
Type Parameters
T
T extends ModelClass<Storable<any, any>>
Parameters
this
T
query
WebdaQLString<InstanceType<T>>
params?
QueryParameters
Returns
Promise<{ continuationToken?: string; results: InstanceType<T>[]; }>
Call Signature
query<
T>(this,filter,options?):Promise<{continuationToken?:string;results:InstanceType<T>[]; }>
Defined in: packages/models/src/repositories/hooks.ts:65
Query operation
Type Parameters
T
T extends ModelClass<Storable<any, any>>
Parameters
this
T
filter
ModelFilter<InstanceType<T>>
options?
FindOptions<InstanceType<T>>
Returns
Promise<{ continuationToken?: string; results: InstanceType<T>[]; }>
ref()
ref<
T>(this,key):ModelRefWithCreate<InstanceType<T>>
Defined in: packages/models/src/repositories/hooks.ts:110
Perform ref
Type Parameters
T
T extends ModelClass<Storable<any, any>>
Parameters
this
T
key
SettablePrimaryKey<InstanceType<T>>
Returns
ModelRefWithCreate<InstanceType<T>>