rejectedsoftware/vibe.d — pull request #171 by Dicebot (2013-01-27 00:17:13+00:00)
Title: Mongo driver refactoring

Wow, it was much faster and much easier than I have expected. Current pull request status: basic changes, "works for me". Probably some enhancement commit will be added if review will take some time, otherwise those will go as separate ones.

Changes copied from git log:

1) vibe.db.mongo.db -> vibe.db.mongo.client
MongoDB -> MongoClient
MongoClient is cleaned up from all database specific features
MongoClient.opIndex removed
MongoClient.getDB added
2) Created new module vibe.db.mongo.db
Created MongoDatabase class
All database service functions moved to MongoDatabase
3) Most vibe.db.mongo.connection stuff is marked as /// private
All vibe.db.mongo.connection symbols intended for user code usage are documented
4) getLastError() root implementation is now in MongoConnection
getLastError() implementation fixed
getLastError() now return immutable POD struct: MongoErrorDescripion
checkLastError() now uses getLastError()
5) MongoHost class -> struct
6) MongoClient now only uses MongoClientSettings in constructor
7) MongoCollection stores MongoDatabase instead on plain name string
8) MongoDatabase basic implementation with old service methods: getLastError,
9) MongoDatabase opIndex
getLog, fsync
9) MongoDatabase.runCommand is package instead of public for better encapsulation

Enhancments:
1) Added MongoDriverException and MongoDBException
All mongo driver code now throws one of those
MongoDBException encapsulated MongoErrorDescripion
2) MongoCollection.remove() overload added