summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonobjbuilder.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-01-02 17:26:58 -0500
committerMathias Stearn <mathias@10gen.com>2015-01-07 11:56:33 -0500
commitf58fa5f78a91ce36d8e31d6730ebfdaa6cc1d5ab (patch)
treebd143554b3ba2f46edaa9a00a12f1e4840c7c142 /src/mongo/bson/bsonobjbuilder.cpp
parentde54755e568481d1bdef37339d899403e3b04d86 (diff)
downloadmongo-f58fa5f78a91ce36d8e31d6730ebfdaa6cc1d5ab.tar.gz
Make BSONObj::woCompare a total ordering
Changes: * Date and Timestamp are now distinct with all Dates before all Timestamps. * Numeric comparisons now correctly handle Doubles and Long > 2**53. * CodeWScope doesn't strcmp BSONObjs or strings which may contain NULs. There should be no changes in any of the cases where woCompare defined a correct total ordering before. The new behavior matches the ordering defined by KeyString. Related tickets: * SERVER-3304 Error comparing Date and Timestamp * SERVER-3719 Total ordering over Longs and Doubles * SERVER-7804 CodeWScope comparisons are broken * SERVER-16632 Change WiredTiger index key format Changes to the comparison function for aggregation will be handled separately as SERVER-16708.
Diffstat (limited to 'src/mongo/bson/bsonobjbuilder.cpp')
-rw-r--r--src/mongo/bson/bsonobjbuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/bson/bsonobjbuilder.cpp b/src/mongo/bson/bsonobjbuilder.cpp
index c914f682e5c..34788b4a962 100644
--- a/src/mongo/bson/bsonobjbuilder.cpp
+++ b/src/mongo/bson/bsonobjbuilder.cpp
@@ -53,7 +53,7 @@ namespace mongo {
appendBool(fieldName, true);
//appendDate( fieldName , numeric_limits<long long>::min() );
return;
- case Timestamp: // TODO integrate with Date SERVER-3304
+ case Timestamp:
appendTimestamp( fieldName , 0 ); return;
case Undefined: // shared with EOO
appendUndefined( fieldName ); return;
@@ -107,7 +107,7 @@ namespace mongo {
appendMinForType( fieldName, Object ); return;
case Date:
appendDate( fieldName , std::numeric_limits<long long>::max() ); return;
- case Timestamp: // TODO integrate with Date SERVER-3304
+ case Timestamp:
append( fieldName , OpTime::max() ); return;
case Undefined: // shared with EOO
appendUndefined( fieldName ); return;