Hai!!

I have done with displaying single collection from mongodb in ejs page, 
when i try to display another collection in same ejs page where i have 
displayed its not displaying instead its shown error!!


please find the attachment!!

Thanks in advance!!

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.






exports.eligible = function( req, res, next ){

if( flag == "1" ){

var user_id = req.cookies ?
    req.cookies.user_id : undefined;
        
        //var visits;
        var visits = req.body.visits;
        console.log(visits);

        Userinfo.find(({ visits : { $gte: visits }}),function ( err, users1 ){
      
      if( err ) return next( err );
           res.render( 'listeligible', {
           title : 'Subway Administration',
          
                  users1 :users1
          
      }); 
   });
   }
else
{
res.redirect('/');
}
};
exports.listeligible = function( req, res, next ){

if( flag == "1" ){


var user_id = req.cookies ?
    req.cookies.user_id : undefined;
        
        var visits = req.body.visits;
        var subs;

        Userinfo.find(function ( err, users1 ){
 
 
      
      if( err ) return next( err );
           res.render( 'listeligible', {
           title : 'Subway Administration',
          
                  users1 :users1
                 
                  
      }); 
                
    
   });
   

    
   }
else
{
res.redirect('/');
}
};










exports.deallist = function(req, res, db) {

        if( flag == "1" ){
    var user_id = req.cookies ?
      req.cookies.user_id : undefined;
  console.log("Deal");
  
  
  
  Subnew.find(function (err, subs){
   if( err ) return next( err );
   res.render( 'editdeal', {
   title   : 'Deal Terms',
   subs   : subs
   //current : req.params.id
   });
  });
  
  
  return function(req, res) {
   var collection = db.get('subways');
   collection.find({},{},function(e,docs){
    res.render('editdeal', {
    "editdeal" : docs
    });
   });
  };
 }
 else{
   res.redirect('/');
  }
 
};

Attachment: listeligible.ejs
Description: Binary data

Attachment: deal.json
Description: Binary data

Reply via email to