Skip to content

Commit c177b50

Browse files
committed
CDRIVER-418 fix bug in C driver example
1 parent 1dbc2fb commit c177b50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/finding-document.page

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ main (int argc,
138138

139139
client = mongoc_client_new ("mongodb://localhost:27017/");
140140
collection = mongoc_client_get_collection (client, "test", "test");
141-
cursor = mongoc_collection_find (collection, MONGOC_QUERY_NONE, 0, 0, 0, query, NULL, NULL);
142-
143141
query = bson_new ();
144142
BSON_APPEND_UTF8 (query, "hello", "world");
145143

144+
cursor = mongoc_collection_find (collection, MONGOC_QUERY_NONE, 0, 0, 0, query, NULL, NULL);
145+
146146
while (mongoc_cursor_next (cursor, &doc)) {
147147
str = bson_as_json (doc, NULL);
148148
printf ("%s\n", str);

0 commit comments

Comments
 (0)