hydrate-mongodb
Version:
An Object Document Mapper (ODM) for MongoDB.
31 lines (30 loc) • 893 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var mappingError_1 = require("./mappingError");
var ReadContext = (function () {
function ReadContext(session) {
this.session = session;
this.path = "";
}
ReadContext.prototype.addError = function (message, path) {
if (!this.errors) {
this.errors = [];
this.hasErrors = true;
}
this.errors.push({
message: message,
path: path || this.path
});
};
ReadContext.prototype.addFetch = function (path) {
if (!this.fetches) {
this.fetches = [];
}
this.fetches.push(path);
};
ReadContext.prototype.getErrorMessage = function () {
return mappingError_1.createErrorMessage(this.errors);
};
return ReadContext;
}());
exports.ReadContext = ReadContext;