Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- let mongoose = require('mongoose');
- mongoose.connect('mongodb://localhost/test');
- console.log(`are we connected to mongodb here? [${mongoose.connection._hasOpened}]`);
- process.nextTick(function() {
- console.log(`how about next tick? [${mongoose.connection._hasOpened}]`);
- });
- setTimeout(function() {
- console.log(`after 100ms: ${mongoose.connection._hasOpened}`);
- }, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement