codeparty/derby — pull request #400 by icaliman (2014-03-22 13:59:18+00:00)
Title: Fixed "Error: no open connecti ons"

This change fixed the error that appear sometimes in console in new projects:

Error: Error setting TTL index on collection : sessions
at F:\Programare\Node.JS\__workspace\modular\node_modules\connect-mongo\lib\
connect-mongo.js:139:23
at F:\Programare\Node.JS\__workspace\modular\node_modules\connect-mongo\node
_modules\mongodb\lib\mongodb\db.js:1227:28
at F:\Programare\Node.JS\__workspace\modular\node_modules\connect-mongo\node
_modules\mongodb\lib\mongodb\db.js:1371:30
at F:\Programare\Node.JS\__workspace\modular\node_modules\connect-mongo\node
_modules\mongodb\lib\mongodb\cursor.js:156:22
at commandHandler (F:\Programare\Node.JS\__workspace\modular\node_modules\co
nnect-mongo\node_modules\mongodb\lib\mongodb\cursor.js:608:48)
at Db._executeQueryCommand (F:\Programare\Node.JS\__workspace\modular\node_m
odules\connect-mongo\node_modules\mongodb\lib\mongodb\db.js:1705:12)
at Cursor.nextObject (F:\Programare\Node.JS\__workspace\modular\node_modules
\connect-mongo\node_modules\mongodb\lib\mongodb\cursor.js:649:13)
at Cursor.toArray (F:\Programare\Node.JS\__workspace\modular\node_modules\co
nnect-mongo\node_modules\mongodb\lib\mongodb\cursor.js:155:10)
at F:\Programare\Node.JS\__workspace\modular\node_modules\connect-mongo\node
_modules\mongodb\lib\mongodb\db.js:1370:65
at Db.collection (F:\Programare\Node.JS\__workspace\modular\node_modules\con
nect-mongo\node_modules\mongodb\lib\mongodb\db.js:484:44)

This error appears because server receives requests before connecting to mongo.