bson_t * query;
query = BCON_NEW("$and","[",
"{", "a", BCON_INT32(1), "}",
"{", "b", "{", "$gte", BCON_INT32(1), "}", "}",
"{", "b", "{", "$lt", BCON_INT32(3), "}", "}",
"]");
//prove it looks right
size_t *s;
const char * as_json;
as_json = bson_as_json(query, s);
crashes on bson_as_json call.
Comment out any single one of the 3 documents in the and list and it works fine.