I'm using Mongoose.js to create models with schemas.
I have a list of models (many) and at times I'd like to get the attributes/keys that make up a particular model.
Is there a method to pull out the attribute schemas for any given model?
For example,
var mySchema = module.exports = new Schema({
SID: {
type: Schema.Types.ObjectId
//, required: true
},
teams: {
type: [String]
},
hats: [{
val: String,
dt: Date
}],
shields: [{
val: String,
dt: Date
}],
shoes: [{
val: String,
dt: Date
}]
}
);
Is it possible to pull out/identify the attributes of the schema [SID, hats, teams, shields, shoes]
??