mirror of
https://github.com/sstent/alex_app1.git
synced 2026-01-25 16:42:02 +00:00
16 lines
323 B
JavaScript
16 lines
323 B
JavaScript
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');
|
|
})
|
|
})
|