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

Bug in C driver example code

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      In the "Specifying a Query" section of http://api.mongodb.org/c/current/finding-document.html , the example uses the "query" variable before it is created. The relevant code should be:

          client = mongoc_client_new ("mongodb://localhost:27017/");
          collection = mongoc_client_get_collection (client, "test", "test");
       
          query = bson_new ();
          BSON_APPEND_UTF8 (query, "hello", "world");
       
          cursor = mongoc_collection_find (collection, MONGOC_QUERY_NONE, 0, 0, 0, query, NULL, NULL);

      Attachments

        Activity

          People

            adam.midvidy Adam Midvidy
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: