[#1711] got it! task.*.history & user.history as defined schemas was the

problem, since they're arrays of >100 each
This commit is contained in:
Tyler Renelle
2013-11-02 12:49:08 -07:00
parent 01536a2e29
commit 838108d579
4 changed files with 8 additions and 25 deletions

View File

@@ -83,8 +83,8 @@ var UserSchema = new Schema({
rest: {type: Boolean, 'default': false} // fixme - change to preferences.resting once we're off derby
},
history: {
exp: [{date: Date, value: Number}],
todos: [{data: Date, value: Number}]
exp: Array, // [{date: Date, value: Number}], // big peformance issues if these are defined
todos: Array //[{data: Date, value: Number}] // big peformance issues if these are defined
},
/* FIXME remove?*/
@@ -209,10 +209,9 @@ UserSchema.methods.toJSON = function() {
doc.filters = {};
doc._tmp = this._tmp; // be sure to send down drop notifs
// TODO why isnt' this happening automatically given the TaskSchema.methods.toJSON above?
_.each(['habits','dailys','todos','rewards'], function(type){
_.each(doc[type],function(task){
task.id = task._id;
task.id = task.id || task._id;
})
})