marcelo-lipienski/mongodb-course-ports — pull request #4 by ytaras (2012-10-24 14:53:55+00:00)
Title: Cabash

I propose to use Casbah library for Scala instead of pure-java Mongo driver. While I agree it's good for this course not to use heavy frameworks which hides mongo internals behind (something like mongoid for Ruby) so we can better learn how to operate with mongo at low-level, still I think it's no stopper for Casbah. Casbah is just a tiny wrapper on Mongo driver which adds Scala-specific semantic to Mongo operations, so I would consider it as a low-level Scala driver for Mongo. If with, say, Ruby or Python we can use built-in iterators (I mean .each here) so why should we bother with .hasNext/.next in Scala? Instead we can use same primitives (collections, documents, etc) but work with them in Scala way. For example .findOne() cursor is an instance of Iterable which means we can use .map, .filter, .flatMap and other stuff which Iterable allows us to do.