Use bson_append_element istead of type-based append