geyser-mongo
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0-beta.1 • Public • Published

    Build Status Codecov NPM version Standard Version dependencies Status devDependencies Status

    Geyser

    Publish and subscribe to streams of data over MongoDB.

    Usage

    Source Node.js process:

    import { Observable } from 'rxjs';
    import { MongoObserver } from 'geyser-mongo';
     
    // Create an Observer which writes to a 'ticks' collection in MongoDB
    const ticks = MongoObserver.connect({
      url: 'mongodb://localhost/my-db',
      collection: 'ticks'
    })
     
    // Subscribe our "ticks" observer to a stream
    Observable.interval(1000).subscribe(ticks);

    Listening Node.js process:

    import { MongoObservable } from 'geyser-mongo';
     
    // create a 
    const ticks = MongoObservable.connect({
      url: 'mongodb://localhost/my-db',
      collection: 'ticks'
    })
     
    // Subscribe to the "ticks" stream
    ticks.subscribe(console.log);
     
    // 1
    // 2
    // 3
    // ...
     

    Install

    npm i geyser-mongo

    DownloadsWeekly Downloads

    1

    Version

    1.0.0-beta.1

    License

    MIT

    Last publish

    Collaborators

    • jasondreyzehner