couple of typos in C Driver documentation

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • 0.5
    • Affects Version/s: 0.4
    • Component/s: None
    • Environment:
      documentation change
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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" ))

      { printf( "name: %s\n", bson_iterator_string( it ) ); }

      }

      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" ))

      { printf( "name: %s\n", bson_iterator_string( iterator ) ); }

      }

      (note: missing semicolon after mongo_cursor_set_query, also "it" becomes "iterator")

            Assignee:
            Kyle Banker (Inactive)
            Reporter:
            Waitman Gobble
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: