Represents the result of an insertOne command on a Table.
insertOne
const result = await table.insertOne({ id: '123', name: 'John'});console.log(result.insertedId); // { id: '123' } Copy
const result = await table.insertOne({ id: '123', name: 'John'});console.log(result.insertedId); // { id: '123' }
The type of the primary key of the table is inferred from the second type-param of the Table.
If not set, it defaults to Partial<RSchema> to keep the result type consistent.
Partial<RSchema>
💡Tip: See the SomePKey type for more information, and concrete examples, on this subject.
The primary key of the inserted (or upserted) row. This will be the same value as the primary key which was present in the row which was just inserted.
See TableInsertOneResult for more information about the primary key.
Overview
Represents the result of an
insertOne
command on a Table.Example
The primary key type
The type of the primary key of the table is inferred from the second type-param of the Table.
If not set, it defaults to
Partial<RSchema>
to keep the result type consistent.See