Home

Awesome

coffee-mongo

Experiment to write a Mongo driver in CoffeeScript on Node.

Possible further experiments for the intrepid


Example

# CoffeeScript
db = new mongo.Database 'test'
db.insert 'Country', { name: 'Iceland', population: 316252 }, (error, document) ->
  db.remove 'Country', { _id: document._id }, (error) ->
    ...

# Javascript
db = new mongo.Database('test');
db.insert('Country', { name: 'Iceland', population: 316252 }, function (error, document) {
  db.remove('Country', { _id: document._id }, function (error) {
    ...
  })
});