Implemented MongoQuery infrastructure.