summaryrefslogtreecommitdiff
path: root/src/mongo/db/index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/index.cpp')
-rw-r--r--src/mongo/db/index.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/index.cpp b/src/mongo/db/index.cpp
index 377679806a4..f7346978313 100644
--- a/src/mongo/db/index.cpp
+++ b/src/mongo/db/index.cpp
@@ -369,11 +369,14 @@ namespace mongo {
verify( sourceCollection );
}
- if ( sourceCollection->findIndexByName(name) >= 0 ) {
+ // Check both existing and in-progress indexes (2nd param = true)
+ if ( sourceCollection->findIndexByName(name, true) >= 0 ) {
// index already exists.
return false;
}
- if( sourceCollection->findIndexByKeyPattern(key) >= 0 ) {
+
+ // Check both existing and in-progress indexes (2nd param = true)
+ if( sourceCollection->findIndexByKeyPattern(key, true) >= 0 ) {
LOG(2) << "index already exists with diff name " << name << ' ' << key.toString() << endl;
return false;
}