Interface CollectionInsertOneResult<RSchema>

Represents the result of an insertOne command on collection.

Field

insertedId - The ID of the inserted document.

See

Collection.insertOne

interface CollectionInsertOneResult<RSchema> {
    insertedId: IdOf<RSchema>;
}

Type Parameters

  • RSchema

Properties

Properties

insertedId: IdOf<RSchema>

The ID of the inserted document (this will be an autogenerated ID if one was not provided).

Note that it is up to the user that the ID covers all possible types of IDs that the collection may have, keeping in mind the type of the auto-generated IDs, as well as any the user may provide.