Created
July 3, 2015 14:07
-
-
Save mrfelton/c28f6c54735628b20f81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/esConnector.js b/lib/esConnector.js | |
index 99318ac..3aa48db 100644 | |
--- a/lib/esConnector.js | |
+++ b/lib/esConnector.js | |
@@ -175,19 +175,20 @@ ESConnector.prototype.setupMappings = function (modelNames, callback) { | |
return !modelNames || _.includes(modelNames, mapping.name); | |
}); | |
log('ESConnector.prototype.setupMappings', 'mappingsToSetUp', _.pluck(mappingsToSetUp, 'name')); | |
- | |
Promise.map( | |
mappingsToSetUp, | |
function (mapping) { | |
+ var mappingName = mapping.name; | |
+ delete mapping.name; | |
return db.indices.putMapping( | |
{ | |
index: settings.index, | |
- type: mapping.name, | |
- body: {properties: mapping.properties} | |
+ type: mappingName, | |
+ body: mapping | |
} | |
).then( | |
function (body) { | |
- log('ESConnector.prototype.setupMappings', mapping.name, body); | |
+ log('ESConnector.prototype.setupMappings', mappingName, body); | |
return Promise.resolve(); | |
}, | |
function (err) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment