node.js - change the default output format mongoose nodejs -
my schema in node js
var itemschema = new mongoose.schema({ name: { type: string, required: true }, value: { type: string } });
while doing find, following result comes,
item.find().exec(callback);
gives result
[{"one":1},{"two":2},{"three":1},{"four":1}]
but want result this,
[{"one":1,"two":2,"three":3,"four":4}]
is there way iterate , form result ?
please suggest me!
Comments
Post a Comment