Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mgo = require('mongodb');
- const assert = require('assert');
- const url = 'mongodb://localhost:27017';
- const dbName = 'contested';
- const client = mgo.MongoClient;
- client.connect(url, function (err, ms) {
- assert.equal(null, err);
- console.log('connected\n');
- const db = ms.db(dbName);
- const raids = db.collection('raids');
- const cs = raids.watch();
- pull(cs);
- });
- async function pull(cs) {
- const next = await cs.next
- console.log(next);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement