"SequoiaDB Giant Sequoia Database" insert() Overview 2

Parameter Description

  • doc|docs (  Object|Object of Arrayrequired  )

    Single or batch records.

  • flag (  Intoptional  )

    The insert flag is used to control the behavior and result of the insert operation. The default value is 0. It can be used alone or through the "bit-and" method to use the following options to control the behavior and results of the insert operation:

    • SDB_INSERT_RETURN_ID: indicates the content of the "_id" field in the return record after successful insertion.
    • SDB_INSERT_CONTONDUP: By default, when an index key conflict occurs, the insert operation will fail and terminate. After setting this option, when an index key conflict occurs, skip this record and continue to insert other records.
    • SDB_INSERT_REPLACEONDUP: By default, when an index key conflict occurs, the insert operation will fail and terminate. After setting this option, when an index key conflict occurs, the existing record will be updated as the new record to be inserted, and other records will continue to be inserted.
  • options (  Objectoptional  )

    Insert options are used to control the behavior and results of insert operations. Parameters are  options equivalent to parameters  flag, and the attribute options are as follows:

    • ReturnOID (  Booloptional  ): It is equivalent to flag the SDB_INSERT_RETURN_ID option in the parameter  .
    • ContOnDup (  Booloptional  ): It is equivalent to flag the SDB_INSERT_CONTONDUP option in the parameter  .
    • ReplaceOnDup (  Booloptional  ): Equivalent to flag the SDB_INSERT_REPLACEONDUP option in the parameter  .

Note:

  • When the inserted record does not contain the "_id" field, SequoiaDB will automatically add an "_id" field to the record to uniquely identify the record.

  • flag The SDB_INSERT_CONTONDUP and SDB_INSERT_REPLACEONDUP options in the parameters  cannot be used in combination at the same time. Use parameter  options case with the use of parameters of  flag the same.

Click on Jushan Database Documentation Center for more information

Guess you like

Origin blog.csdn.net/weixin_48909806/article/details/112940714