Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. 'use strict';
  2.  
  3. let mongoose = require('mongoose');
  4. mongoose.connect('mongodb://localhost/test');
  5.  
  6. console.log(`are we connected to mongodb here? [${mongoose.connection._hasOpened}]`);
  7.  
  8. process.nextTick(function() {
  9. console.log(`how about next tick? [${mongoose.connection._hasOpened}]`);
  10. });
  11.  
  12. setTimeout(function() {
  13. console.log(`after 100ms: ${mongoose.connection._hasOpened}`);
  14. }, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement