samedi 29 novembre 2014

Cast a mongoose schema to JSON


Vote count:

0




how to cast a mongoose schema as json. for example convert:



var InfoSchema = new Schema({
name: {
type: String,
required: true
},
title: {
type: String,
required: true,
trim: true
}
});


to somthing like:



schema = {
type: "object",
properties: {
name: { type: "string"},
title: {
type: "string"
}
};


asked 41 secs ago







Cast a mongoose schema to JSON

Aucun commentaire:

Enregistrer un commentaire