Casbah 2.0 / 2011-01-03
Notable Changes since Casbah 1.0.8.1:
Ownership Change: Casbah is now an officially supported MongoDB Driver
- Casbah is now broken into several submodules - see http://api.mongodb.org/scala/casbah/migrating.html
- Casbah releases are now published to http://scala-tools.org
- SBT Build now publishes -sources and -javadoc artifacts
- Added heavy test coverage
- ++ additivity operator on MongoDBObject for lists of tuple pairs
Updates to Java Driver wrappings
- Casbah now wraps Java Driver 2.4 and fully supports all options & interfaces including Replica Set and Write Concern support
- added a WriteConcern helper object for Scala users w/ named & default args
- added findAndModify / findAndRemove
- Stripped out support for implicit Product/Tuple conversions as they're buggy and constantly interfere with other code.
Migrated Conversions code from core to commons, repackaging as com.mongodb.casbah.commons.conversions
- Moved loading of ConversionHelpers from Connection creation to instantiation of Commons' Implicits (This means conversions are ALWAYS loaded now for everyone)
Switched off of configgy to slf4j as akka did
Added SLF4J-JCL Bindings as a +test dependency (so we can print logging while testing without forcing you to use an slf4j implementation yourself)
- Moved Logger from core to commons
Massive improvements to Query DSL:
- Added new implementations of $in, $nin, $all and $mod with tests. $mod now accepts non-Int numerics and aof two differing types.
- Full test coverage on DSL (and heavy coverage on other modules)
- Migrated $each to a now functioning internal hook on $addToSet only exposed in certain circumstances
- Various cleanups to Type constraints in Query DSL
- Full support for all documented MongoDB query operators
- Added new $not syntax, along with identical support for nested queries in $pull
- Valid Date and Numeric Type boundaries introduced and used instead of Numeric (since Char doesn't actually workwith Mongo and you can't double up type bounds)
- Added full support for geospatial query.
- Resolved an issue where the $or wasn't being broken into individual documents as expected.
- DSL Operators now return DBObjects rather than Product/Tuple (massive fixes to compatibility and performance result)
- Added @see linkage to each core operator's doc page
GridFS Changes:
- GridFS' `files' now returned a MongoCursor not a raw Java DBCursor
- GridFS findOne now returns an Option[_] and detects nulls like Collection
Added "safely" resource loaning methods on Collection & DB
- Given an operation, uses write concern / durability on a single connection and throws an exception if anything goes wrong.
- Culled casbah-mapper. Mapper now lives as an independent project at http://github.com/maxaf/casbah-mapper
- Bumped version of scala-time to the 0.2 release
- Added DBList support via MongoDBList, following 2.8 collections
- Adjusted boundaries on getAs and expand; the view-permitting Any was causing ambiguity issues at runtime with non AnyRefs (e.g. AnyVal).
- Fixed an assumption in expand which could cause runtime failure
- Updated MongoDBObject factory & builder to explicitly return a type; some pieces were assuming at runtime that it was a MongoDBObjectBuilder$anon1 which was FUBAR
Casbah is the Scala toolkit for MongoDB, providing Scala wrappers to the Java driver, a DSL query syntax and full Scala type support (MongoDB will never give you a Java type from Casbah unless you asked it to).
Casbah wraps the official MongoDB Java Driver and provides the functionality and tools that Scala developers expect without reinventing the wheel uneccessarily. The current (latest) version has been tested against MongoDB 1.6.x with Java driver 2.3.
If you previously used Casbah 1.x, the package has changed from com.novus.mongodb.casbah to com.mongodb.casbah, and ownership has moved to the MongoDB project. New documentation for the 2.x series is forthcoming but core functionality remains mostly the same from 1.x (From a user standpoint).
This work is an Open Source project under the Apache License v2.
Got questions, problems, suggestions? Please join the Casbah Users' Mailing List