
indexOf works. It has worked before. Now it says TypeError: Object -57 has no method 'indexOf' totals = _.reduce(findObjs({ pageid: page, type: 'graphic', isdrawing: false, layer: 'objects' }),function(m,o){ log(o.get('_id')); if(o.get('name').indexOf( 'Treasury' ) > -1) { m.treasury+=parseFloat(o.get('bar3_value')) || 0; } return m; },{ bar1: 0, bar2: 0, cityIncome: 0, numberOfcities: 0, treasury: 0, resourceIncome: 0}); // this is where you initialize fields but checking the _id of the object turns out: "-K08foEXiyy8ZuuVyORh" "-K08h-y2pZjxrTKeHGIW" "-K08i9nf6wr_lBhWNDDe" How do I find which one is object -57, to help with debugging?