SODA collection class. A SODA collection is a set of SodaDocuments.

See

https://github.com/oracle/node-oracledb/blob/v5.0.0/doc/api.md#sodacollectionclass

Hierarchy

  • ISodaCollection

Accessors

Methods

  • Inserts an array of Objects or SodaDocuments into the collection.

    See

    https://github.com/oracle/node-oracledb/blob/v5.0.0/doc/api.md#sodacollinsertmany

    Throws

    an exception if a document insertion fails. The offset attribute on the Error object will contain the number of documents that were successfully inserted. Subsequent documents in the input array will not be inserted.

    Parameters

    • docs: (Record<string, any> | ISodaDocument)[]

      an array of Objects or SodaDocuments to be inserted into the collection.

    Returns void

  • Inserts an array of Objects or SodaDocuuments into the collection and returns the documents which contain all SodaDocument components except for content, for performance reasons.

    See

    https://github.com/oracle/node-oracledb/blob/v5.0.0/doc/api.md#sodacollinsertmanyandget

    Returns

    an array of inserted SodaDocuments.

    Throws

    an exception if a document insertion fails. The offset attribute on the Error object will contain the number of documents that were successfully inserted. Subsequent documents in the input array will not be inserted.

    Parameters

    • docs: (Record<string, any> | ISodaDocument)[]

      an array of Objects or SodaDocuments to be inserted into the collection.

    Returns ISodaDocument[]

  • This method behaves like sodaCollection.insertOne() with the exception that if a document with the same key already exists, then it is updated instead. The collection must use client-assigned keys, which is why save() accepts only a SodaDocument, unlike insertOne(). If the collection is not configured with client-assigned keys, then the behavior is exactly the same as sodaCollection.insertOne().

    See

    https://github.com/oracle/node-oracledb/blob/v5.0.0/doc/api.md#user-content-sodacollsave

    Parameters

    Returns void