-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Storage Execution
This would have major fallout across the codebase, but I think would improve things. I was just recently authoring a patch and ran across the following strange behavior.
The correct way to build a BSON object with MinKey and MaxKey for testing is like so:
BSON("" << MINKEY << "" << MAXKEY)
But this code actually compiles also:
BSON("" << MinKey << "" << MaxKey)
After several minutes or maybe an hour of insanity, I realized that when I typed the second one I had actually constructed this object:
{"": -1, "": 127}
because it was reading from the BSONType enum and converting to an integer...
I do not think I will be the last person to make this mistake in a test.