ravendb
Version:
RavenDB client for Node.js
84 lines • 3.17 kB
JavaScript
import { CountersIndexDefinition } from "./CountersIndexDefinition.js";
import { AbstractIndexCreationTaskBase } from "../AbstractIndexCreationTaskBase.js";
export class AbstractRawJavaScriptCountersIndexCreationTask extends AbstractIndexCreationTaskBase {
_definition = new CountersIndexDefinition();
constructor() {
super();
}
get maps() {
return this._definition.maps;
}
set maps(value) {
this._definition.maps = value;
}
get fields() {
return this._definition.fields;
}
set fields(value) {
this._definition.fields = value;
}
get reduce() {
return this._definition.reduce;
}
set reduce(value) {
this._definition.reduce = value;
}
get isMapReduce() {
return !!this.reduce;
}
/**
* @return If not null than each reduce result will be created as a document in the specified collection name.
*/
get outputReduceToCollection() {
return this._definition.outputReduceToCollection;
}
/**
* @param value If not null than each reduce result will be created as a document in the specified collection name.
*/
set outputReduceToCollection(value) {
this._definition.outputReduceToCollection = value;
}
/**
* @return Defines a collection name for reference documents created based on provided pattern
*/
get patternReferencesCollectionName() {
return this._definition.patternReferencesCollectionName;
}
/**
* @param value Defines a collection name for reference documents created based on provided pattern
*/
set patternReferencesCollectionName(value) {
this._definition.patternReferencesCollectionName = value;
}
/**
* @return Defines a collection name for reference documents created based on provided pattern
*/
get patternForOutputReduceToCollectionReferences() {
return this._definition.patternForOutputReduceToCollectionReferences;
}
/**
* @param value Defines a collection name for reference documents created based on provided pattern
*/
set patternForOutputReduceToCollectionReferences(value) {
this._definition.patternForOutputReduceToCollectionReferences = value;
}
createIndexDefinition() {
this._definition.name = this.getIndexName();
this._definition.type = this.isMapReduce ? "JavaScriptMapReduce" : "JavaScriptMap";
this._definition.name = this.getIndexName();
if (this.additionalSources) {
this._definition.additionalSources = this.additionalSources;
}
else {
this._definition.additionalSources = {};
}
this._definition.additionalAssemblies = this.additionalAssemblies || [];
this._definition.configuration = this.configuration;
this._definition.lockMode = this.lockMode;
this._definition.priority = this.priority;
this._definition.state = this.state;
this._definition.deploymentMode = this.deploymentMode;
return this._definition;
}
}
//# sourceMappingURL=AbstractRawJavaScriptCountersIndexCreationTask.js.map