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

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -