MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / nativeInsert

Method nativeInsert

packages/mongodb/src/MongoDriver.ts:322–332  ·  view source on GitHub ↗
(
    entityName: EntityName<T>,
    data: EntityDictionary<T>,
    options: NativeInsertUpdateOptions<T> = {},
  )

Source from the content-addressed store, hash-verified

320 }
321
322 async nativeInsert<T extends object>(
323 entityName: EntityName<T>,
324 data: EntityDictionary<T>,
325 options: NativeInsertUpdateOptions<T> = {},
326 ): Promise<QueryResult<T>> {
327 this.handleVersionProperty(entityName, data);
328 data = this.renameFields(entityName, data);
329 return this.rethrow(
330 this.getConnection('write').insertOne(entityName, data, options.ctx, options.signal),
331 ) as unknown as Promise<QueryResult<T>>;
332 }
333
334 override async nativeClone<T extends object>(
335 entityName: EntityName<T>,

Callers

nothing calls this directly

Calls 5

handleVersionPropertyMethod · 0.95
renameFieldsMethod · 0.95
rethrowMethod · 0.80
insertOneMethod · 0.80
getConnectionMethod · 0.65

Tested by

no test coverage detected