@@ -835,7 +835,6 @@ async def insert_document(
835835
836836 async def update_document (
837837 self ,
838- collection : str ,
839838 document : Json ,
840839 ignore_revs : Optional [bool ] = None ,
841840 wait_for_sync : Optional [bool ] = None ,
@@ -851,7 +850,6 @@ async def update_document(
851850 """Update a document.
852851
853852 Args:
854- collection (str): Collection name.
855853 document (dict): Partial or full document with the updated values.
856854 It must contain the "_key" or "_id" field.
857855 ignore_revs (bool | None): If set to `True`, the `_rev` attribute in the
@@ -891,7 +889,9 @@ async def update_document(
891889 References:
892890 - `update-a-document <https://docs.arangodb.com/stable/develop/http-api/documents/#update-a-document>`__
893891 """ # noqa: E501
894- col : StandardCollection [Json , Json , Jsons ] = self .collection (collection )
892+ col : StandardCollection [Json , Json , Jsons ] = self .collection (
893+ Collection .get_col_name (document )
894+ )
895895 return await col .update (
896896 document ,
897897 ignore_revs = ignore_revs ,
@@ -908,7 +908,6 @@ async def update_document(
908908
909909 async def replace_document (
910910 self ,
911- collection : str ,
912911 document : Json ,
913912 ignore_revs : Optional [bool ] = None ,
914913 wait_for_sync : Optional [bool ] = None ,
@@ -922,7 +921,6 @@ async def replace_document(
922921 """Replace a document.
923922
924923 Args:
925- collection (str): Collection name.
926924 document (dict): New document. It must contain the "_key" or "_id" field.
927925 Edge document must also have "_from" and "_to" fields.
928926 ignore_revs (bool | None): If set to `True`, the `_rev` attribute in the
@@ -956,7 +954,9 @@ async def replace_document(
956954 References:
957955 - `replace-a-document <https://docs.arangodb.com/stable/develop/http-api/documents/#replace-a-document>`__
958956 """ # noqa: E501
959- col : StandardCollection [Json , Json , Jsons ] = self .collection (collection )
957+ col : StandardCollection [Json , Json , Jsons ] = self .collection (
958+ Collection .get_col_name (document )
959+ )
960960 return await col .replace (
961961 document ,
962962 ignore_revs = ignore_revs ,
@@ -971,7 +971,6 @@ async def replace_document(
971971
972972 async def delete_document (
973973 self ,
974- collection : str ,
975974 document : str | Json ,
976975 ignore_revs : Optional [bool ] = None ,
977976 ignore_missing : bool = False ,
@@ -984,7 +983,6 @@ async def delete_document(
984983 """Delete a document.
985984
986985 Args:
987- collection (str): Collection name.
988986 document (str | dict): Document ID, key or body. The body must contain the
989987 "_key" or "_id" field.
990988 ignore_revs (bool | None): If set to `True`, the `_rev` attribute in the
@@ -1017,7 +1015,9 @@ async def delete_document(
10171015 References:
10181016 - `remove-a-document <https://docs.arangodb.com/stable/develop/http-api/documents/#remove-a-document>`__
10191017 """ # noqa: E501
1020- col : StandardCollection [Json , Json , Jsons ] = self .collection (collection )
1018+ col : StandardCollection [Json , Json , Jsons ] = self .collection (
1019+ Collection .get_col_name (document )
1020+ )
10211021 return await col .delete (
10221022 document ,
10231023 ignore_revs = ignore_revs ,
0 commit comments