-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Programmability
-
SP Prioritized List
Deprecate and replace the "BSON literal" syntax with something other than an even-odd-toggling operator<<. Currently clang-format has no idea how to break these chains into pairs, and humans have a hard time counting the elements to determine what the resulting structure is.
Example:
BSON("aggregate" << collName << "cursor" << BSONObj{} << "pipeline" << BSON_ARRAY(BSON("$collStats" << BSON("storageStats" << BSON( "waitForLock" << false << "numericOnly" << true)))))),
This kind of thing becomes a completely different arrangement if it's indented, etc, so it's also a churn generator.
I'm certain we can produce a more fluent builder syntax that clang-format will be able to understand and format as proper hierarchical subexpression groupings.