MCPcopy Create free account
hub / github.com/chainjet/platform / findById

Method findById

libs/common/src/TypegooseQueryService.ts:175–178  ·  view source on GitHub ↗

* Find an entity by it's `id`. * * @example * ```ts * const todoItem = await this.service.findById(1); * ``` * @param id - The id of the record to find. * @param opts - Additional options

(id: string, opts?: FindByIdOptions<Entity>)

Source from the content-addressed store, hash-verified

173 * @param opts - Additional options
174 */
175 async findById(id: string, opts?: FindByIdOptions<Entity>): Promise<Entity | undefined> {
176 const doc = await this.Model.findOne(this.mergeFilterWithId(id, opts?.filter))
177 return (doc as any)?.toObject(this.documentToObjectOptions) as Entity
178 }
179
180 /**
181 * Gets an entity by it's `id`. If the entity is not found a rejected promise is returned.

Callers 15

getByIdMethod · 0.95
runWorkflowActionsMethod · 0.80
wakeUpWorkflowRunMethod · 0.80
runWorkflowOnFailureMethod · 0.80
runActionMethod · 0.80
runMethod · 0.80
viewerContactMethod · 0.80
updateViewerContactMethod · 0.80
updateOneMethod · 0.80

Calls 2

mergeFilterWithIdMethod · 0.95
findOneMethod · 0.80

Tested by

no test coverage detected