theCollection, about 60 objects theArray, average 80 object db.theCollection.find({}, { pro:1, id: 1, title: 1, theArray:1 }).forEach( function(z) { z.theArray.forEach( function(p){ print(z.title+' - '+p.title+' # '+p.gwid); db.theCollection.update( { 'theArray.gwid': p.gwid}, { $set: { 'theArray.$.pro': z.pro } } ) } ) print(z.id+' - '+z.title+' '+z.theArray.length); }) 2014-05-21T07:56:11.212+0000 [conn209501] SEVERE: Invalid access at address: 0x20039e0e02 2014-05-21T07:56:11.281+0000 [conn209501] SEVERE: Got signal: 11 (Segmentation fault). Backtrace:0x11bd301 0x11bc6de 0x11bc7cf 0x7f6a571f85b0 0x796892 0x796fbf 0x79773d 0x7979ff 0xc3d34a 0xc48ca6 0xb8f1c9 0xb993e8 0x76b76f 0x117367b 0x7f6a571f0f18 0x7f6a56506e0d /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x11bd301] /data/mongodb-linux-x86_64-2.6.0/bin/mongod() [0x11bc6de] /data/mongodb-linux-x86_64-2.6.0/bin/mongod() [0x11bc7cf] /lib64/libpthread.so.0(+0xf5b0) [0x7f6a571f85b0] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZNK5mongo11mutablebson8Document4Impl12writeElementINS_16BSONArrayBuilderEEEvjPT_PKNS_10StringDataE+0x52) [0x796892] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZNK5mongo11mutablebson8Document4Impl13writeChildrenINS_16BSONArrayBuilderEEEvjPT_+0x4f) [0x796fbf] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZNK5mongo11mutablebson8Document4Impl12writeElementINS_14BSONObjBuilderEEEvjPT_PKNS_10StringDataE+0x22d) [0x79773d] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZNK5mongo11mutablebson8Document4Impl13writeChildrenINS_14BSONObjBuilderEEEvjPT_+0x4f) [0x7979ff] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZN5mongo6updateERKNS_13UpdateRequestEPNS_7OpDebugEPNS_12UpdateDriverEPNS_14CanonicalQueryE+0x115a) [0xc3d34a] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZN5mongo14UpdateExecutor7executeEv+0x66) [0xc48ca6] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZN5mongo14receivedUpdateERNS_7MessageERNS_5CurOpE+0x729) [0xb8f1c9] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0xec8) [0xb993e8] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x9f) [0x76b76f] /data/mongodb-linux-x86_64-2.6.0/bin/mongod(_ZN5mongo17PortMessageServer17handleIncomingMsgEPv+0x4fb) [0x117367b] /lib64/libpthread.so.0(+0x7f18) [0x7f6a571f0f18] /lib64/libc.so.6(clone+0x6d) [0x7f6a56506e0d]