Thursday, 22 August 2013

how to return full object with mongoose

how to return full object with mongoose

i was wondering if there is a way to retrieve the full document (even with
the undefined and empty keys ) .
here is my schema :
var userSchema = new Schema({
username : {type: String, index: {unique: true, dropDups: true}} ,
password : String ,
email : {type: String, index: {unique: true, dropDups: true}} ,
gender : String
})
lets say the for some user the gender isnt defined , when i query i only
get the username, password and email .. how can i get the gender as well
?!
sorry if there is any wrong technical terms .

No comments:

Post a Comment