summaryrefslogtreecommitdiff
path: root/db/update.h
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2010-06-30 08:56:42 +0200
committerAntonin Kral <a.kral@bobek.cz>2010-06-30 08:56:42 +0200
commit5c6a2219e6715bd7649c3fd28f58e6fb63d60a25 (patch)
tree1eda5f5ca9bd35190fe499a51119e855774b16c0 /db/update.h
parentdf7046adebaeb16716b5a2cebc6f34694f530caf (diff)
downloadmongodb-5c6a2219e6715bd7649c3fd28f58e6fb63d60a25.tar.gz
Imported Upstream version 1.4.4
Diffstat (limited to 'db/update.h')
-rw-r--r--db/update.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/db/update.h b/db/update.h
index 3c4daab..bfec7cd 100644
--- a/db/update.h
+++ b/db/update.h
@@ -413,7 +413,7 @@ namespace mongo {
void appendForOpLog( BSONObjBuilder& b ) const {
if ( incType ){
BSONObjBuilder bb( b.subobjStart( "$set" ) );
- appendIncValue( bb );
+ appendIncValue( bb , true );
bb.done();
return;
}
@@ -434,14 +434,16 @@ namespace mongo {
}
template< class Builder >
- void appendIncValue( Builder& b ) const {
+ void appendIncValue( Builder& b , bool useFullName ) const {
+ const char * n = useFullName ? m->fieldName : m->shortFieldName;
+
switch ( incType ){
case NumberDouble:
- b.append( m->shortFieldName , incdouble ); break;
+ b.append( n , incdouble ); break;
case NumberLong:
- b.append( m->shortFieldName , inclong ); break;
+ b.append( n , inclong ); break;
case NumberInt:
- b.append( m->shortFieldName , incint ); break;
+ b.append( n , incint ); break;
default:
assert(0);
}