Ejemplo n.º 1
0
 void dupCheck(vector<IndexChanges>& v, NamespaceDetails& d, DiskLoc curObjLoc) {
     int z = d.nIndexesBeingBuilt();
     for( int i = 0; i < z; i++ ) {
         IndexDetails& idx = d.idx(i);
         v[i].dupCheck(idx, curObjLoc);
     }
 }
Ejemplo n.º 2
0
 void getIndexChanges(vector<IndexChanges>& v, NamespaceDetails& d, BSONObj newObj, BSONObj oldObj, bool &changedId) {
     int z = d.nIndexesBeingBuilt();
     v.resize(z);
     for( int i = 0; i < z; i++ ) {
         IndexDetails& idx = d.idx(i);
         BSONObj idxKey = idx.info.obj().getObjectField("key"); // eg { ts : 1 }
         IndexChanges& ch = v[i];
         idx.getKeysFromObject(oldObj, ch.oldkeys);
         idx.getKeysFromObject(newObj, ch.newkeys);
         if( ch.newkeys.size() > 1 )
             d.setIndexIsMultikey(i);
         setDifference(ch.oldkeys, ch.newkeys, ch.removed);
         setDifference(ch.newkeys, ch.oldkeys, ch.added);
         if ( ch.removed.size() > 0 && ch.added.size() > 0 && idx.isIdIndex() ) {
             changedId = true;
         }
     }
 }