Details
-
Improvement
-
Resolution: Done
-
Minor - P4
-
0.4
-
None
-
documentation change
Description
Documentation update request (C Driver Tutorial)
http://api.mongodb.org/c/current/tutorial.html
The example code under the heading "Simple Queries"
subheading "Let's now write a function which prints out the name of all persons whose age is 24"
mongo_cursor_init( cursor, conn, "tutorial.persons" );
mongo_cursor_set_query( cursor, query )
while( mongo_cursor_next( cursor ) == MONGO_OK ) {
bson_iterator iterator[1];
if ( bson_find( iterator, mongo_cursor_bson( cursor ), "name" ))
}
should be
mongo_cursor_init( cursor, conn, "tutorial.persons" );
mongo_cursor_set_query( cursor, query );
while( mongo_cursor_next( cursor ) == MONGO_OK ) {
bson_iterator iterator[1];
if ( bson_find( iterator, mongo_cursor_bson( cursor ), "name" ))
}
(note: missing semicolon after mongo_cursor_set_query, also "it" becomes "iterator")