tableflip/ssb-mongo-connect

Name: ssb-mongo-connect

Owner: TABLEFLIP

Description: Connect ssb messages to mongo collections.

Created: 2017-06-12 10:05:16.0

Updated: 2017-06-12 10:14:33.0

Pushed: 2017-06-12 11:12:57.0

Homepage:

Size: 81

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ssb-mongo-connect Build Status dependencies Status

Connect ssb messages to mongo collections.

sbot = require('scuttlebot')({ /* ... */ })
connect = require('ssb-mongo-connect')

db = require('mongojs')('blog', ['posts'])
Posts = db.collection('posts')

conn = connect(sbot, 'add-post')(Posts)
ll future add-post messages will now appear in the Posts collection
Call `conn.abort()` to stop)
API
connect(sbot, messageType[, opts])(collection)

Connect scuttlebot messages of type messageType to the mongo collection.

Returns a pull-abortable instance, allowing you to call abort([err]) in order to stop the connection.


A (?°?°???TABLEFLIP side project.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.