title: Query mongodb C
body: <p>I'm trying to make a query that must to retrieve some data from my mongodb database, follow my code:</p>
  
  <pre><code> 72     mongo conn[1];
   73     mongo_cursor cursor[1];
   74 
   75     //Parameters (connection, IP, port);
   76     int status = mongo_connect(conn, "127.0.0.1", 27017);
   77     if(status != MONGO_OK){
   78         switch(conn-&gt;err){
   79             case MONGO_CONN_NO_SOCKET: printf("Socket not found\n"); return 1;
   80             case MONGO_CONN_FAIL: printf("Connection Failed\n"); return 1;
   81             case MONGO_CONN_NOT_MASTER: printf("Not master\n"); return 1;
   82         }
   83     }
   84 
   85     //add_new_service(conn, 55, 75,"java","7");
   86     bson query[1];
   87     bson_init(query);
   88     bson_append_start_object(query, "$query");
   89         bson_append_int(query,"cpu",75);
   90     bson_append_finish_object(query);
   91     bson_finish(query);
   92 
   93     bson fields[1];
   94     bson_init(fields);
   95     bson_append_null(fields,"machine");
   96     bson_finish(fields);
   97 
   98     mongo_cursor_init(cursor, conn, "db.services");
   99 
  100     cursor = mongo_find(conn,"db.services", query, fields, 9999, 0, 0);
  101 
  102     while(mongo_cursor_next(ptr_cursor) == MONGO_OK){
  103         bson_print(&amp;ptr_cursor-&gt;current);
  104     }
  105 
  106     mongo_cursor_destroy(cursor);
  107     mongo_destroy(conn);
  108     return 0;
  </code></pre>
  
  <p>I don't know how can i use the method "mongo_find" (line 100), it returns a pointer to a mongo_cursor, but i can't manipulate this pointer, some ideas to help me achieve this?</p>