1
0
mirror of /repos/Prototyper.git synced 2025-12-30 06:31:32 +01:00

update attribute in stead of overwriting

This commit is contained in:
Aiko Mastboom 2013-04-18 23:22:09 +02:00
parent 098f0fce02
commit 8aed6f75cd

View File

@ -179,10 +179,14 @@ module.exports = function (config) {
}
};
config.debug && console.log('getMongoAttribute attribute_options', attribute_options);
return getMongoContent(attribute_options, function (err, attribute_result) {
getMongoContent(attribute_options, function (err, attribute_result) {
if (attribute_result) {
config.debug && console.log('getMongoAttribute found lost attribute, reconnect');
result[options.attribute] = { guid: attribute_result._id };
if (result[options.attribute]) {
result[options.attribute].guid = attribute_result._id;
} else {
result[options.attribute] = { guid: attribute_result._id };
}
return saveData(col, result, callback);
} else {