Skip to content
Node.js,, Ruby, MongoDB tailed cursor demo
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Tractor Push

This is a demonstration of a client that accepts two message streams from a server asynchronously. The left box updates on the arrival of the 'all messages' stream: simple, array, or complex. The right box updates from a message stream of only 'complex' type. The streams are independent but draw from the same source.

A running version of the demo is at: TODO ADD URL

The server is node.js running It reads from a capped MongoDB database with a tailable cursor. A secondary set of servers (it happens to be in Ruby) originally wrote to the database.

Note: Sequence numbers may not be unique.

In the online demo, the node.js and Ruby components are running on Heroku's Celedon Cedar stack. The MongoDB database is hosted at MongoLab. See this URL 'TODO: add URL' for more information.


See: (TODO: URL) for detailed instructions on how to run the demo, but succintly:

  • Create a mongodb database 'testdatabase' with a capped collection 'messages' on localhost OR use Heroku and create a MONGOLAB database.
  • Run tractorpush-inserter-ruby to insert files TODO NEED URL
  • Run 'npm install' Run tractorpush-server (this project): 'node.js app.js'
  • Point your browser to http://localhost:2000 and enjoy

Inserter Ruby

The insertion code is at

REQUIRES (ok, it may run with something less)

  • Node.js 0.6.9 +
  • npm 1.1.0-3
  • see package.json for more dependencies ( and mongodb)


  • Make this demo more obvious what to do if a newbie (or a pointer to the blog entry).
  • Make this demo server insert one document if it finds a blank database (which means creating a capped collection.) or at least send a reasonable message to the user somehow.

Original Demo: 2012 March by ObjectLabs Corporation, makers of hosted MongoDB.

If you have comment or questions please contact us at @mongolab on Twitter or support AT Thanks for looking.

Legal stuff

Copyright 2012 ObjectLabs Corporation.

Code licensed under the Apache License, Version 2.0 (the "Apache License"); you may not use this file except in compliance with the Apache License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for the specific language governing permissions and limitations under the Apache License.

Non-code content licensed under Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) at

Something went wrong with that request. Please try again.