@@ -67,6 +67,61 @@ def query(
6767 not 2xx, then the entire response is always returned.
6868 """
6969 path = "v1/rows/graphql" if graphql else "v1/rows"
70+ return self .__send_request (
71+ path ,
72+ dsl ,
73+ plan ,
74+ sql ,
75+ sparql ,
76+ graphql ,
77+ format ,
78+ tx ,
79+ return_response ,
80+ ** kwargs ,
81+ )
82+
83+ def update (
84+ self ,
85+ dsl : str = None ,
86+ format : str = "json" ,
87+ tx : Transaction = None ,
88+ return_response : bool = False ,
89+ ** kwargs ,
90+ ):
91+ """
92+ Sends an update query to an endpoint at the MarkLogic rows service defined at
93+ https://docs.marklogic.com/REST/client/row-management. Note that this feature
94+ requires the use of MarkLogic version 11.2 or later.
95+
96+ For more information about Optic Update and using the Optic DSL,
97+ see https://docs.marklogic.com/guide/app-dev/OpticAPI.
98+ TODO - add links for Optic Update.
99+
100+ :param dsl: an Optic DSL query
101+ :param tx: optional REST transaction in which to service this request.
102+ :param return_response: boolean specifying if the entire original response
103+ object should be returned (True) or if only the data should be returned (False)
104+ upon a success (2xx) response. Note that if the status code of the response is
105+ not 2xx, then the entire response is always returned.
106+ """
107+ path = "v1/rows/update"
108+ return self .__send_request (
109+ path , dsl , None , None , None , None , format , tx , return_response , ** kwargs
110+ )
111+
112+ def __send_request (
113+ self ,
114+ path : str = None ,
115+ dsl : str = None ,
116+ plan : dict = None ,
117+ sql : str = None ,
118+ sparql : str = None ,
119+ graphql : str = None ,
120+ format : str = "json" ,
121+ tx : Transaction = None ,
122+ return_response : bool = False ,
123+ ** kwargs ,
124+ ):
70125 headers = kwargs .pop ("headers" , {})
71126 data = None
72127 if graphql :
0 commit comments