Closed thekid closed 2 years ago
Implements #14 and adds change streams:
use com\mongodb\MongoConnection; use util\cmd\Console; $c= new MongoConnection($dsn); $c->connect(); // Watch a collection $cursor= $c->collection('dialog', 'entries')->watch(); // Watch a database $cursor= $c->database('dialog')->watch(); // Watch all databases $cursor= $c->watch(); foreach ($cursor as $change) { Console::writeLine('>> ', $change); }
Implements #14 and adds change streams: