Parameter Description
-
doc|docs
( Object|Object of Array , required )Single or batch records.
-
flag
( Int , optional )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
( Object , optional )Insert options are used to control the behavior and results of insert operations. Parameters are
options
equivalent to parametersflag
, and the attribute options are as follows:ReturnOID
( Bool , optional ): It is equivalent toflag
the SDB_INSERT_RETURN_ID option in the parameter .ContOnDup
( Bool , optional ): It is equivalent toflag
the SDB_INSERT_CONTONDUP option in the parameter .ReplaceOnDup
( Bool , optional ): Equivalent toflag
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 parameteroptions
case with the use of parameters offlag
the same.
Click on Jushan Database Documentation Center for more information