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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -