summaryrefslogtreecommitdiff
path: root/db/jsobj.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-06-25 15:43:41 -0400
committerEliot Horowitz <eliot@10gen.com>2010-06-25 15:43:41 -0400
commit9959f32daab0512b79daa0a00875836d4ae25f97 (patch)
treea920cfe889f0ae9623198911768bbbaed93382ac /db/jsobj.cpp
parent373172d27262a7dad1628662e9be14d00f33e8ec (diff)
downloadmongo-9959f32daab0512b79daa0a00875836d4ae25f97.tar.gz
open to BSONObj::woCompare to treak compare key as dotted
Diffstat (limited to 'db/jsobj.cpp')
-rw-r--r--db/jsobj.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/db/jsobj.cpp b/db/jsobj.cpp
index e12a0844d19..c8c1a7d06dc 100644
--- a/db/jsobj.cpp
+++ b/db/jsobj.cpp
@@ -641,7 +641,7 @@ namespace mongo {
BSONObj staticNull = fromjson( "{'':null}" );
/* well ordered compare */
- int BSONObj::woSortOrder(const BSONObj& other, const BSONObj& sortKey ) const{
+ int BSONObj::woSortOrder(const BSONObj& other, const BSONObj& sortKey , bool useDotted ) const{
if ( isEmpty() )
return other.isEmpty() ? 0 : -1;
if ( other.isEmpty() )
@@ -655,10 +655,10 @@ namespace mongo {
if ( f.eoo() )
return 0;
- BSONElement l = getField( f.fieldName() );
+ BSONElement l = useDotted ? getFieldDotted( f.fieldName() ) : getField( f.fieldName() );
if ( l.eoo() )
l = staticNull.firstElement();
- BSONElement r = other.getField( f.fieldName() );
+ BSONElement r = useDotted ? other.getFieldDotted( f.fieldName() ) : other.getField( f.fieldName() );
if ( r.eoo() )
r = staticNull.firstElement();