[CDRIVER-418] Bug in C driver example code Created: 08/Sep/14  Updated: 03/May/17  Resolved: 10/Sep/14

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kevin Pulo Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

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



 Comments   
Comment by Adam Midvidy [ 09/Sep/14 ]

https://github.com/mongodb/mongo-c-driver/pull/72

Generated at Wed Feb 07 21:09:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.