diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-06-18 21:24:54 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-06-18 21:24:54 +0200 |
commit | fefb1e355f6cbe35160f2f73ed68a38d95fa59a2 (patch) | |
tree | faecb2fb6677516c5f6d9edfae8475344ddd73ed /db/commands/mr.cpp | |
parent | d95b46b2bbb5b4246213f252010508489b4e5719 (diff) | |
parent | 64b33ee522375a8dc15be2875dfb7db4502259b0 (diff) | |
download | mongodb-fefb1e355f6cbe35160f2f73ed68a38d95fa59a2.tar.gz |
Merge commit 'upstream/1.8.2'
Diffstat (limited to 'db/commands/mr.cpp')
-rw-r--r-- | db/commands/mr.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/db/commands/mr.cpp b/db/commands/mr.cpp index 16c604a..b9f5b59 100644 --- a/db/commands/mr.cpp +++ b/db/commands/mr.cpp @@ -758,7 +758,18 @@ namespace mongo { BSONObj fast_emit( const BSONObj& args ) { uassert( 10077 , "fast_emit takes 2 args" , args.nFields() == 2 ); uassert( 13069 , "an emit can't be more than half max bson size" , args.objsize() < ( BSONObjMaxUserSize / 2 ) ); - (*_tl)->emit( args ); + + if ( args.firstElement().type() == Undefined ) { + BSONObjBuilder b( args.objsize() ); + b.appendNull( "" ); + BSONObjIterator i( args ); + i.next(); + b.append( i.next() ); + (*_tl)->emit( b.obj() ); + } + else { + (*_tl)->emit( args ); + } return BSONObj(); } |