summaryrefslogtreecommitdiff
path: root/src/mongo/db/index.cpp
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-04-16 21:09:09 -0400
committerHari Khalsa <hkhalsa@10gen.com>2013-04-18 09:38:42 -0400
commit8cfa93578c541b046903dd9b40e7eb9f46156fb9 (patch)
treebde421228542b8d014106b547ef91d71e5fd1486 /src/mongo/db/index.cpp
parent7a24fedbb3cdd55b2d204143a0cc605e391aa884 (diff)
downloadmongo-8cfa93578c541b046903dd9b40e7eb9f46156fb9.tar.gz
migrate 2d and fts command, update logic, SERVER-8791 SERVER-9164
Diffstat (limited to 'src/mongo/db/index.cpp')
-rw-r--r--src/mongo/db/index.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/mongo/db/index.cpp b/src/mongo/db/index.cpp
index ef22cbbceb7..82944bd188d 100644
--- a/src/mongo/db/index.cpp
+++ b/src/mongo/db/index.cpp
@@ -251,34 +251,6 @@ namespace mongo {
}
}
- void getIndexChanges(vector<IndexChanges>& v, const char *ns, NamespaceDetails& d,
- BSONObj newObj, BSONObj oldObj, bool &changedId) {
- int z = d.getTotalIndexCount();
- 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(ns, 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;
- }
- }
- }
-
- void dupCheck(vector<IndexChanges>& v, NamespaceDetails& d, DiskLoc curObjLoc) {
- int z = d.getTotalIndexCount();
- for( int i = 0; i < z; i++ ) {
- IndexDetails& idx = d.idx(i);
- v[i].dupCheck(idx, curObjLoc);
- }
- }
-
// should be { <something> : <simpletype[1|-1]>, .keyp.. }
static bool validKeyPattern(BSONObj kp) {
BSONObjIterator i(kp);
@@ -477,16 +449,4 @@ namespace mongo {
}
_init(rules);
}
-
- void IndexChanges::dupCheck(IndexDetails& idx, DiskLoc curObjLoc) {
- if (added.empty() ||
- !idx.unique() ||
- ignoreUniqueIndex(idx)) {
- return;
- }
- const Ordering ordering = Ordering::make(idx.keyPattern());
-
- // "E11001 duplicate key on update"
- idx.idxInterface().uassertIfDups(idx, added, idx.head, curObjLoc, ordering);
- }
}