Posted in Uncategorized

Mongoose Handy function for reference

Some handy functions in mongoose

  • Pagination with mongoose

    
    npm install mongoose-paginate
    Model.paginate({}, { page: 3, limit: 10 }, function(err, result) {
    
    //result.docs
    // result.total
    // result.limit - 10
    // result.page - 3
    // result.pages
     });
    
Advertisements

Author:

I am a passionate software developer currently located in Bengaluru. I love creating beautiful stuffs, reading and soccer. When I am not in front of the PC, you'll find me EITHER day dreaming ;-) OR playing soccer OR reading . FCB and NEUFC are my favorite clubs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s