Project

mongopipe

0.01
No commit activity in last 3 years
No release in over 3 years
MongoDB Pipe powered by PubNub.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
>= 0
 Project Readme

Streaming Geo Coordinates from MongoDB to iPhone with WebSockets and PubNub

PubNub MongoDB Pipe to iOS iPhone via WebSocket

Get your PubNub API Keys

http://www.pubnub.com/

First you'll need to get your PubNub API keys by visiting [http://admin.pubnub.com/](PubNub Account Dashboard)

Install MongoDB

Setup MongoDB - OSX

curl http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.2.2.tgz > mongodb-osx-x86_64-2.2.2.tgz

Uncompress

tar xvfz mongodb-osx-x86_64-2.2.2.tgz

Add default MongoDB Directory

mkdir -p /data/db

Run MongoDB Server

mongodb-osx-x86_64-2.2.2/bin/mongod

Run MongoDB Interactive JS Console

mongodb-osx-x86_64-2.2.2/bin/mongo

Install Ruby Packages

Make sure you have Ruby 1.9.3 installed.

gem update --system
gem install pubnub
gem install mongo
gem install mongopipe ## MongoDB Pipe
gem install bson_ext

Run PubNub MongoDB Ruby Pipe

You may run the Pipe by issuing this simple command then follow the instructions that print out to test.

Run Pipe via CURL

ruby <(curl http://goo.gl/bUlUh)

You can also download the Pipe file first then run it locally. This basically will save the Ruby source code file to your local hard drive and you can execute it anytime you need to.

Download First

curl http://goo.gl/bUlUh > pipe.rb

Then Run Locally

ruby ./pipe.rb

Follow the Output Instructions. That's it!

The following section only shows a sample insertable document that triggers replication broadcast to the map.

Mongo Console

Next go back to your mongodb console and type the following commands:

use test
db.cap_collection.insert({ latlon : [ 1.5, 2.0 ] })