0
私はプロジェクトに取り組んで、カーソルの文書(MongoDBの)の量をカウントする必要がありますよC&BSONでMongo Cursorの文書を数えます。 BSONとC.と
ここでは私のコードです:
bson_buffer_init(query_buf);
bson_append_string(query_buf, "url", bson_iterator_string(it));
bson_from_buffer(query, query_buf);
similar = mongo_find(conn, "testing.test", query, NULL, 0, 0, 0);
while(mongo_cursor_next(similar))
{
bson_iterator it2[1];
if(bson_find(it2, &similar->current, "url"))
{
printf("%s\n", bson_iterator_string(it2));
}
}
私はこれを変更するだろうか各カーソル内の文書を数えるために(上記はループであり、urlは各パスごとに異なります)