Bug in C driver example code

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

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

              Assignee:
              Adam Midvidy (Inactive)
              Reporter:
              Kevin Pulo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: