You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
var db = pmongo(mongodbConfig.url, mongodbConfig.options, mongodbConfig.collections);
for(var i in mongodbConfig.collections) {
db[mongodbConfig.collections[i]].remove();
}
return Promise.all(formDefinitions.map(function (formDefinitionItem) {
var formDefinition = {};
for(var formDefinitionProperty in formDefinitionItem) {
if(formDefinitionItem.hasOwnProperty(formDefinitionProperty)) {
if(formDefinitionProperty != 'pages') {
formDefinition[formDefinitionProperty] = formDefinitionItem[formDefinitionProperty];
}
}
}
return db[mongodbConfig.collections[0]].insert(formDefinition);
})).then(function(allFormDefinitions) {
When I run this code no exceptions are thrown but the database (looking with the mongo shell) seems empty. Can you see anything obvious that I am doing wrong? The variable 'formDefinitions' is an array that I know is created correctly. The string mongodbConfig.collections is an array of strings and in this case so the string 'formDefinitions'. I have set a breakpoint at each return and the variable 'formDefinition' is correct. I am having a hard time seeing what is wrong that would cause the collection to be empty without error.
Thank you.
Kevin
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have the following code:
When I run this code no exceptions are thrown but the database (looking with the mongo shell) seems empty. Can you see anything obvious that I am doing wrong? The variable 'formDefinitions' is an array that I know is created correctly. The string mongodbConfig.collections is an array of strings and in this case so the string 'formDefinitions'. I have set a breakpoint at each return and the variable 'formDefinition' is correct. I am having a hard time seeing what is wrong that would cause the collection to be empty without error.
Thank you.
Kevin
The text was updated successfully, but these errors were encountered: