@@ -1322,6 +1322,9 @@ def insert_many(
1322
1322
silent : bool = False ,
1323
1323
overwrite : bool = False ,
1324
1324
return_old : bool = False ,
1325
+ overwrite_mode : Optional [str ] = None ,
1326
+ keep_none : Optional [bool ] = None ,
1327
+ merge : Optional [bool ] = None ,
1325
1328
) -> Result [Union [bool , List [Union [Json , ArangoServerError ]]]]:
1326
1329
"""Insert multiple documents.
1327
1330
@@ -1359,6 +1362,21 @@ def insert_many(
1359
1362
:param return_old: Include body of the old documents if replaced.
1360
1363
Applies only when value of **overwrite** is set to True.
1361
1364
: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.
1362
1380
:return: List of document metadata (e.g. document keys, revisions) and
1363
1381
any exception, or True if parameter **silent** was set to True.
1364
1382
:rtype: [dict | ArangoServerError] | bool
@@ -1375,6 +1393,13 @@ def insert_many(
1375
1393
if sync is not None :
1376
1394
params ["waitForSync" ] = sync
1377
1395
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
+
1378
1403
request = Request (
1379
1404
method = "post" ,
1380
1405
endpoint = f"/_api/document/{ self .name } " ,
0 commit comments