mongodb-schema
Version:
Infer the probabilistic schema for a MongoDB collection.
26 lines • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.InternalSchemaBasedAccessor = void 0;
class InternalSchemaBasedAccessor {
constructor(internalSchema, converters) {
this.internalSchema = internalSchema;
this.converters = converters;
}
async getInternalSchema() {
return this.internalSchema;
}
async getStandardJsonSchema(options = {}) {
var _a;
return (_a = this.standardJSONSchema) !== null && _a !== void 0 ? _a : (this.standardJSONSchema = await this.converters.internalToStandard(this.internalSchema, options));
}
async getMongoDBJsonSchema(options = {}) {
var _a;
return (_a = this.mongodbJSONSchema) !== null && _a !== void 0 ? _a : (this.mongodbJSONSchema = await this.converters.internalToMongoDB(this.internalSchema, options));
}
async getExpandedJSONSchema(options = {}) {
var _a;
return (_a = this.expandedJSONSchema) !== null && _a !== void 0 ? _a : (this.expandedJSONSchema = await this.converters.internalToExpanded(this.internalSchema, options));
}
}
exports.InternalSchemaBasedAccessor = InternalSchemaBasedAccessor;
//# sourceMappingURL=schema-accessor.js.map