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

Method createOne

libs/common/src/TypegooseQueryService.ts:211–215  ·  view source on GitHub ↗

* Creates a single entity. * * @example * ```ts * const todoItem = await this.service.createOne({title: 'Todo Item', completed: false }); * ``` * @param record - The entity to create.

(record: C)

Source from the content-addressed store, hash-verified

209 * @param record - The entity to create.
210 */
211 async createOne<C extends DeepPartial<Entity>>(record: C): Promise<Entity> {
212 const doc = new this.Model(record)
213 await doc.save(record)
214 return doc.toObject(this.documentToObjectOptions) as Entity
215 }
216
217 /**
218 * Create multiple entities.

Callers 10

createManyMethod · 0.95
setMethod · 0.45
createOrderMethod · 0.45
createUserMethod · 0.45
createWorkflowMethod · 0.45
logMethod · 0.45
createOrUpdateOneFunction · 0.45
createOneFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected