@@ -218,36 +218,35 @@ However, this doesn't map well to the syntax so you can also use a capital S ins
218218
219219Raw queries
220220-----------
221- It is possible to provide a raw :mod: `PyMongo ` query as a query parameter or update as a update parameter , which will
222- be integrated directly into the query or update. This is done using the ``__raw__ ``
223- keyword argument::
221+ It is possible to provide a raw :mod: `PyMongo ` query as a query parameter, which will
222+ be integrated directly into the query. This is done using the ``__raw__ `` keyword argument::
224223
225224 Page.objects(__raw__={'tags': 'coding'})
226225
227- # or for update
228-
229- Page.objects(__raw__={'tags': 'coding'}).update(__raw__={'$set': {'tags': 'coding'}})
226+ Similarly, a raw update can be provided to the :meth: `~mongoengine.queryset.QuerySet.update ` method::
230227
231228 Page.objects(tags='coding').update(__raw__={'$set': {'tags': 'coding'}})
232229
233- .. versionadded :: 0.4
230+ And the two can also be combined::
231+
232+ Page.objects(__raw__={'tags': 'coding'}).update(__raw__={'$set': {'tags': 'coding'}})
234233
235234
236235Update with Aggregation Pipeline
237- -----------
236+ --------------------------------
238237It is possible to provide a raw :mod: `PyMongo ` aggregation update parameter, which will
239- be integrated directly into the update. This is done by using ``__raw__ `` field and value of array
240- pipeline
238+ be integrated directly into the update. This is done by using ``__raw__ `` keyword argument to the update method
239+ and provide the pipeline as a list
241240`Update with Aggregation Pipeline <https://docs.mongodb.com/manual/reference/method/db.collection.updateMany/#update-with-aggregation- >`_
242- keyword argument ::
241+ ::
243242
244243 # 'tags' field is set to 'coding is fun'
245244 Page.objects(tags='coding').update(__raw__=[
246245 {"$set": {"tags": {"$concat": ["$tags", "is fun"]}}}
247246 ],
248247 )
249248
250- .. versionadded :: 0.4
249+ .. versionadded :: 0.23.2
251250
252251Sorting/Ordering results
253252========================
0 commit comments