Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-106

couple of typos in C Driver documentation

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 0.5
    • 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" ))

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

      Attachments

        Activity

          People

            kbanker Kyle Banker
            waitman Waitman Gobble
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: