Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (18 sloc) 894 Bytes
.. default-domain:: mongodb
.. operator:: $comment
.. include:: /includes/extracts/mongo-shell-deprecated-meta-operator-comment.rst
The :operator:`$comment` meta-operator makes it possible to attach a comment
to a query in any context that :operator:`$query` may appear.
.. include:: /includes/fact-comment-reason.rst
Use :operator:`$comment` in one of the following ways:
.. code-block:: javascript
db.collection.find( { <query> } )._addSpecial( "$comment", <comment> )
db.collection.find( { <query> } ).comment( <comment> )
db.collection.find( { $query: { <query> }, $comment: <comment> } )
To attach comments to query expressions in other contexts, such as
:method:`db.collection.update()`, use the :query:`$comment` query
operator instead of the meta-operator.
.. seealso:: :query:`$comment` query operator
You can’t perform that action at this time.