, , , .
-, , , , BCON ( ), , , timestamp (: {"$gte":1460703944149, "$lt":1460703944683 }. JSON , , , . , , , , , BSON_APPEND_UTF8 , , UTF8. tutorial:
BSON_APPEND_UTF8() , { "hello": "world" }...
BSON_APPEND_UTF8 (query, "hello", "world");
timestamp , UTF8. , , $gte $lt, /. userId , , .
bson_append_<insert datatype here>, , - ( , , ):
bson_t *query;
bson_t timestampDoc;
query = bson_new();
BSON_APPEND_DOCUMENT_BEGIN(query, "timestamp", ×tampDoc);
bson_append_date_time(×tampDoc, "$gte", -1, 1460703944149);
bson_append_date_time(×tampDoc, "$lt", -1, 1460703944683);
bson_append_document_end(query, ×tampDoc);
BSON_APPEND_UTF8(query, "userId", "manaf");
, BCON:
bson_t *query;
query = BCON_NEW("timestamp",
"{",
"$gte", BCON_INT64(1460703944149),
"$lt", BCON_INT64(1460703944683),
"}",
"userId", BCON_UTF8("manaf"),
);