checking of field in a document
Let's say I have the following schema


     var userSchema = new Schema({
        name : String
      });

      var User = mongoose.model('User',userSchema);

And now I want to check existing of 'age' field in the shema, so I'm finding something like the followins;
     
     var user = new User({name:'Victor'});
     user.save(function(err){
        if(err) throw err;
        User.findOne({},function(err,user){
            if(err) throw err;              
              var nameExists = user.isFieldExists('name'); // to be true
              var ageExists = user. isFieldExists ('age');    // to be false 
            })
        })
checking of field in a document
===

Let's say I have the following schema


     var userSchema = new Schema({
        name : String
      });

      var User = mongoose.model('User',userSchema);

And now I want to check existing of 'age' field in the shema, so I'm finding something like the followins;
     
     var user = new User({name:'Victor'});
     user.save(function(err){
        if(err) throw err;
        User.findOne({},function(err,user){
            if(err) throw err;              
              var nameExists = user.isFieldExists('name'); // to be true
              var ageExists = user. isFieldExists ('age');    // to be false 
            })
        })