0

I am trying to call all the elements in a collection and it is giving Maximum call stack size exceeded error. the code is below.

router.get('/users',counsellorValidate, function(req, res, next) {
    users.find({},function(err,user) {
            res.render('counsellor/counsellorHome',{'userData':user,'user':req.session.user});
    });
});

Database Schema is given Below.

var userSchema = new Schema({
    first_name:{ 
        type: String, 
        required: true 
    },
    last_name:{ 
        type: String, 
        required: true 
    },
    email:{ 
        type: String, 
        required: true,
        unique: true  
    },
    altEmail:{ 
        type: String, 
    },
    password:{ 
        type: String, 
        required: true,
    },
    phone:{ 
        mobile:Number,
        isd:Number,
        std:Number,
        landline:Number
    },
    dob:Date,
    address:{
        line1:String,
        line2:String,
        city:String,
        state:String,
        country:String,
        pin:String
    },
    fb:String,
    twitter:String,
    linkedIn:String,
    blog:String,
    skype:String,
    maritial:String,
    gender:String,
    profile:{
        name:String,
        original_name:String
    },
    summary:String,
    resume:{
        name:String,
        original_name:String
    },
    education: [{
        school_name:String,
        city:String,
        state:String,
        board:String,
        marks:String,
        year:String,
        medium:String,
        specialization:String,
        mode :String
    }],
    scores : {
        gre:Number,
        gmat:Number,
        sat:Number,
        ielts:Number,
        toefl:Number,
        pte:Number
    },
    _email:{
        type:Boolean,
        required:true,
        default:false
    },
    _approved:{
        type:Boolean,
        required:true,
        default:false
    },
});

I have tried increasing the stack size but it gives segmentation error code dumped error.

Stennie
  • 63,885
  • 14
  • 149
  • 175
koushikmln
  • 648
  • 6
  • 23
  • Removed answer since it is not really relevant. However, since you are getting maximum call stack size reached I think you are calling some function in a loop that is not ending when you expect it to. This has happened to me and the problem ended up being a callback not invoked somewhere. I think you may need to post more code to put it in context. – chriskelly Jan 18 '16 at 08:03
  • I managed to solve this. the issue was with swig. swig was throwing this error as there was an uninitialized variable. – koushikmln Jan 18 '16 at 19:54
  • glad to hear you got it sorted! – chriskelly Jan 18 '16 at 22:09

1 Answers1

0

I managed to solve this. the issue was with swig. swig was throwing this error as there was an uninitialized variable.

koushikmln
  • 648
  • 6
  • 23