mirror of
https://github.com/sstent/alex_app1.git
synced 2026-01-27 09:32:44 +00:00
lots of work so far-- mostly tidying
This commit is contained in:
15
node_modules/mongoskin/examples/close.js
generated
vendored
Normal file
15
node_modules/mongoskin/examples/close.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var db = require('./config').db;
|
||||
|
||||
db.collection('test').findOne({}, function(err, data) {
|
||||
if(!err) {
|
||||
console.log('db has open');
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
|
||||
process.on('SIGINT', function() {
|
||||
console.log('Recieve SIGINT');
|
||||
db.close(function(){
|
||||
console.log('database has closed');
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user