This repository has been archived by the owner. It is now read-only.
Stream results from Mongo through Hapi
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
index.js
json-stream.js
output.json
package.json
routes.js

README.md

hapi-mongo-stream

This is an example of how you can stream results from MongoDB through Hapi.

Prerequisites

  • Node ~0.12.0
  • MongoDB

Usage

Create a MongoDB database called hapi-mongo-stream and add some documents to a collection called things.

$ mongo
> use hapi-mongo-stream
switched to db hapi-mongo-stream
> db.things.insert({"name": "thing 1"})
WriteResult({ "nInserted" : 1 })
> db.things.insert({"name": "thing 2"})
WriteResult({ "nInserted" : 1 })
> db.things.insert({"name": "thing 3"})
WriteResult({ "nInserted" : 1 })

Now fire up the server.

npm install
npm start

Point your browser to http://localhost:3000/ to see some documents.