UNPKG

@dolittle/sdk.projections

Version:

Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.

30 lines 2.06 kB
"use strict"; // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.MongoDBCopies = void 0; const CollectionName_1 = require("./CollectionName"); /** * Represents the specification of MongoDB read model copies to produce for a projection. */ class MongoDBCopies { /** * Initialises a new instance of the {@link MongoDBCopies} class. * @param {boolean} shouldCopyToMongoDB - A value indicating whether or not to produce read model copies to a MongoDB collection. * @param {CollectionName} collectionName - The name of the collection to copy read models to. * @param {PropertyConversion[]} conversions - The conversions to apply when copying read models. */ constructor(shouldCopyToMongoDB, collectionName, conversions) { this.shouldCopyToMongoDB = shouldCopyToMongoDB; this.collectionName = collectionName; this.conversions = conversions; } /** * Gets the default {@link MongoDBCopies} specification, where no read model copies will be produced in MongoDB. */ static get default() { return new MongoDBCopies(false, CollectionName_1.CollectionName.notSet, []); } } exports.MongoDBCopies = MongoDBCopies; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTW9uZ29EQkNvcGllcy5qcyIsInNvdXJjZVJvb3QiOiIuLi8iLCJzb3VyY2VzIjpbIkNvcGllcy9Nb25nb0RCL01vbmdvREJDb3BpZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtDQUErQztBQUMvQyxxR0FBcUc7OztBQUVyRyxxREFBa0Q7QUFHbEQ7O0dBRUc7QUFDSCxNQUFhLGFBQWE7SUFDdEI7Ozs7O09BS0c7SUFDSCxZQUNhLG1CQUE0QixFQUM1QixjQUE4QixFQUM5QixXQUFpQztRQUZqQyx3QkFBbUIsR0FBbkIsbUJBQW1CLENBQVM7UUFDNUIsbUJBQWMsR0FBZCxjQUFjLENBQWdCO1FBQzlCLGdCQUFXLEdBQVgsV0FBVyxDQUFzQjtJQUMzQyxDQUFDO0lBRUo7O09BRUc7SUFDSCxNQUFNLEtBQUssT0FBTztRQUNkLE9BQU8sSUFBSSxhQUFhLENBQUMsS0FBSyxFQUFFLCtCQUFjLENBQUMsTUFBTSxFQUFFLEVBQUUsQ0FBQyxDQUFDO0lBQy9ELENBQUM7Q0FDSjtBQW5CRCxzQ0FtQkMifQ==