Function insert

  • Insert a value into a collection. Adds an _id field to the value if one is not provided using the bson ID generator (similar to MongoDB IDs).

    Type Parameters

    Parameters

    • context: Context

      the context to use

    • collectionName: string

      name of the collection

    • value: Record<string, unknown>

      value to insert

    Returns Promise<DocumentType>

    a copy of the inserted value, with appended _id field if not provided

    Throws

    when an item with the same _id already exists

Generated using TypeDoc