0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00
mongodb/db/lasterror.cpp

30 lines
663 B
C++

// lasterror.cpp
#include "stdafx.h"
#include "lasterror.h"
#include "jsobj.h"
namespace mongo {
boost::thread_specific_ptr<LastError> lastError;
LastError LastError::noError;
void LastError::appendSelf( BSONObjBuilder &b ) {
if ( !valid ) {
b.appendNull( "err" );
b.append( "n", 0 );
return;
}
if ( msg.empty() )
b.appendNull( "err" );
else
b.append( "err", msg );
if ( updatedExisting != NotUpdate )
b.appendBool( "updatedExisting", updatedExisting == True );
b.append( "n", nObjects );
}
} // namespace mongo