From 67d5ea83e74221f9e68e237a2e7121cf5e137efe Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Thu, 5 Dec 2013 13:33:01 -0500 Subject: [PATCH] replace . with \uff0e in mongo --- src/database/mongo.js | 7 ++++++- src/routes/debug.js | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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