diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2013-10-08 12:06:00 -0400 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2013-10-10 21:51:57 -0400 |
commit | 80c79f8464d26ca128b2455a8e02c9882f8c4640 (patch) | |
tree | 4868936fefef2bcd3694bf6fb5ff2a5fd0c662ea /src/mongo/db/lasterror.cpp | |
parent | c1ab952e098b24f691f2fd5e6bf162a972b9c5f9 (diff) | |
download | mongo-80c79f8464d26ca128b2455a8e02c9882f8c4640.tar.gz |
SERVER-1351: return new _id from inserted doc from update
Diffstat (limited to 'src/mongo/db/lasterror.cpp')
-rw-r--r-- | src/mongo/db/lasterror.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/lasterror.cpp b/src/mongo/db/lasterror.cpp index e239ac8addc..fd9129e7ed1 100644 --- a/src/mongo/db/lasterror.cpp +++ b/src/mongo/db/lasterror.cpp @@ -77,9 +77,9 @@ namespace mongo { b.append( "code" , code ); if ( updatedExisting != NotUpdate ) b.appendBool( "updatedExisting", updatedExisting == True ); - if ( upsertedId.isSet() ) - b.append( "upserted" , upsertedId ); - + if ( !upsertedId.isEmpty() ) { + b.append( upsertedId[kUpsertedFieldName] ); + } b.appendNumber( "n", nObjects ); return ! msg.empty(); |