@@ -1322,6 +1322,9 @@ def insert_many(
13221322 silent : bool = False ,
13231323 overwrite : bool = False ,
13241324 return_old : bool = False ,
1325+ overwrite_mode : Optional [str ] = None ,
1326+ keep_none : Optional [bool ] = None ,
1327+ merge : Optional [bool ] = None ,
13251328 ) -> Result [Union [bool , List [Union [Json , ArangoServerError ]]]]:
13261329 """Insert multiple documents.
13271330
@@ -1359,6 +1362,21 @@ def insert_many(
13591362 :param return_old: Include body of the old documents if replaced.
13601363 Applies only when value of **overwrite** is set to True.
13611364 :type return_old: bool
1365+ :param overwrite_mode: Overwrite behavior used when the document key
1366+ exists already. Allowed values are "replace" (replace-insert),
1367+ "update" (update-insert), "ignore" or "conflict".
1368+ Implicitly sets the value of parameter **overwrite**.
1369+ :type overwrite_mode: str | None
1370+ :param keep_none: If set to True, fields with value None are retained
1371+ in the document. Otherwise, they are removed completely. Applies
1372+ only when **overwrite_mode** is set to "update" (update-insert).
1373+ :type keep_none: bool | None
1374+ :param merge: If set to True (default), sub-dictionaries are merged
1375+ instead of the new one overwriting the old one. Applies only when
1376+ **overwrite_mode** is set to "update" (update-insert).
1377+ :type merge: bool | None
1378+ :return: Document metadata (e.g. document key, revision) or True if
1379+ parameter **silent** was set to True.
13621380 :return: List of document metadata (e.g. document keys, revisions) and
13631381 any exception, or True if parameter **silent** was set to True.
13641382 :rtype: [dict | ArangoServerError] | bool
@@ -1375,6 +1393,13 @@ def insert_many(
13751393 if sync is not None :
13761394 params ["waitForSync" ] = sync
13771395
1396+ if overwrite_mode is not None :
1397+ params ["overwriteMode" ] = overwrite_mode
1398+ if keep_none is not None :
1399+ params ["keepNull" ] = keep_none
1400+ if merge is not None :
1401+ params ["mergeObjects" ] = merge
1402+
13781403 request = Request (
13791404 method = "post" ,
13801405 endpoint = f"/_api/document/{ self .name } " ,
0 commit comments