ravendb
Version:
RavenDB client for Node.js
25 lines • 1.04 kB
JavaScript
import { CountersIndexDefinition } from "./CountersIndexDefinition.js";
import { AbstractIndexDefinitionBuilder } from "../AbstractIndexDefinitionBuilder.js";
import { throwError } from "../../../Exceptions/index.js";
export class CountersIndexDefinitionBuilder extends AbstractIndexDefinitionBuilder {
map;
constructor(indexName) {
super(indexName);
}
_newIndexDefinition() {
return new CountersIndexDefinition();
}
toIndexDefinition(conventions, validateMap = true) {
if (!this.map && validateMap) {
throwError("InvalidArgumentException", "Map is required to generate an index, you cannot create an index without a valid Map property (in index " + this._indexName + ").");
}
return super.toIndexDefinition(conventions, validateMap);
}
_toIndexDefinition(indexDefinition, conventions) {
if (!this.map) {
return;
}
indexDefinition.maps.add(this.map);
}
}
//# sourceMappingURL=CountersIndexDefinitionBuilder.js.map