node.js - how can I increase the connections for mongoose in nodejs -


i need run 10 queries simultaneously. how do in nodejs application. doing right

var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost:27017/testdb', function(err) { if(err) {     console.log(err); } else {     console.log('connected database'); } }); 

what should solve problem. or should change in db configuration.

you can increase poolsize while connecting. try this

var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost:27017/testdb', {server: { poolsize: 50 }}, function(err) { if(err) {     console.log(err); } else {     console.log('connected database'); } });  

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -