Skip to content

Commit 4839021

Browse files
committed
CDRIVER-987 link to "find" command doc
1 parent 86bb932 commit 4839021

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/mongoc_collection_find.page

+8-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ print_all_documents (mongoc_collection_t *collection)
9494

9595
<section id="find-command">
9696
<title>The "find" command</title>
97-
<p>Queries have historically been sent as OP_QUERY wire protocol messages, but beginning in MongoDB 3.2 queries use the "find" command instead.</p>
97+
<p>Queries have historically been sent as OP_QUERY wire protocol messages, but beginning in MongoDB 3.2 queries use <link href="https://docs.mongodb.org/master/reference/command/find/">the "find" command</link> instead.</p>
9898
<p>The driver automatically converts queries to the new "find" command syntax if needed, so this change is typically invisible to C Driver users. However, an application written exclusively for MongoDB 3.2 and later can choose to use the new syntax directly instead of relying on the driver to convert from the old syntax:</p>
9999
<code mime="text/x-csrc"><![CDATA[/* MongoDB 3.2+ "find" command syntax */
100100
query = BCON_NEW ("filter", "{", "foo", BCON_INT32 (1), "}",
@@ -121,8 +121,14 @@ cursor = mongoc_collection_find (collection, MONGOC_QUERY_NONE, 0, 0, 0, query,
121121
<td><p>Other $-options</p></td> <td><p><code>$&lt;option name&gt;</code></p></td> <td><p><code>&lt;option name&gt;</code></p></td>
122122
</tr>
123123
</table>
124-
<p>See the MongoDB Manual for a list of all "find" command options.</p>
125124
<p>Most applications should use the OP_QUERY syntax, with "$query", "$orderby", and so on, and rely on the driver to convert to the new syntax if needed. There are two caveats: querying documents by a key named "filter", and using new "find" command options that OP_QUERY does not support.</p>
125+
126+
<section id="seealso">
127+
<title>See Also</title>
128+
<p><link href="https://docs.mongodb.org/master/reference/command/find/">The "find" command</link> in the MongoDB Manual.</p>
129+
</section>
130+
131+
126132
<section id="key-named-filter">
127133
<title>Finding a document by a key named "filter"</title>
128134
<p>To find a document like <code mime="x-json">{ "_id": 1, "filter": "value" }</code>, this query works in MongoDB before 3.2:</p>

0 commit comments

Comments
 (0)