fixed support for EJSON in mocks, added support for $query