diff --git a/src/database/mongo.js b/src/database/mongo.js index 4ba91da50e..4b577cf9c6 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -148,6 +148,8 @@ module.setObjectField = function(key, field, value, callback) { var data = {}; + // if there is a '.' in the field name it inserts subdocument in mongo, replace '.'s with \uff0E + field = field.replace(/\./g, '\uff0E'); data[field] = value; db.collection('objects').update({_key:key}, {$set:data}, {upsert:true, w: 1}, function(err, result) { if(callback) { @@ -185,7 +187,7 @@ var _fields = {}; for(var i=0; i