Here is a list of the major items where we have deviated from the MongoDB code and a little bit about why:
.cpp file in the MongoDB code but to keep things clean and separate they have been broken out into files named the same and only rarely is there more than one class within a single fileBSON vs JSONBSON-specific code has become equivalent JSON-specific code since that's what we're working with (no need for needless conversions)addToBson... and other BSONObjBuilder-related methods that take in an instance to be modified but it's owned by the caller; in mungedb-aggregate we build a new Object and return it because it's simpler and that's how they're generally used anyhowDocument classDocument now provides static helpers rather than instance helpers to avoid unnecessary boxing/unboxing since that seems to make more sense here (we treat any Object like a Document)Value classValue now provides static helpers rather than instance helpers to avoid unnecessary boxing/unboxing since that seems to make more sense here (we treat any Object like a `Value)Value#get{TYPE} methods have been renamed to Value.verify{TYPE} since that seemed to make more sense given what they're really doing for us as staticsValue.coerceToDate static returns a JavaScript Date object rather than milliseconds since that seems to make more sense where possibleExpression classesExpression base class
ObjectCtx class no longer uses contants and bitmask flags, instead it takes an Object with similarly named Booleans; e.g., {isDocumentOk:true} rather than DOCUMENT_OKExpression{FOO} classes have all been renamed to {FOO}Expression to satisfy my naming OCD.{FOO}Expression classes do not provide create statics since calling new is easy enough
CompareExpression class doesn't provide any of it's various create{FOO} helpers so compensate I am just binding the appropriate args to the constructor to create a similar factoryDocumentSource classesreset method for all document sources so that we can reuse them against different streams of data