-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 0.6
-
Component/s: None
-
None
Hi gjmurakami,
BCON looks amazing, thanks for writing this! I see the potential of much clearer C code in our futures =).
Looking at how we currently use libmongoc, it looks like we can't switch over to BCON because we have many places in our code where we test if the value passes a condition before we insert the key/value pair. Simple example:
bson doc[1]; bson_init(doc); bson_append_new_oid(doc, "_id"); if (match != -1) bson_append_bool(doc, "match", match); if (domain != NULL) bson_append_string(doc, "dom", domain); if (user != NULL) bson_append_string(doc, "user", user); ...
I wonder if it would be possible to somehow satisfy this use case as well. The BCON spec is nice and clean, and I don't really have a solution in mind that wouldn't clutter it up somehow. Some food for thought, I guess =).
Sam