ottoman
Version:
Ottoman Couchbase ODM
14 lines • 517 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildMapViewIndexFn = void 0;
const buildMapViewIndexFn = (metadata, fields) => {
const { modelKey, modelName } = metadata;
const docFields = fields.map((field) => `doc.${field}`);
return `function (doc, meta) {
if (doc.${modelKey} == "${modelName}") {
emit([${docFields.join(',')}], null);
}
}`;
};
exports.buildMapViewIndexFn = buildMapViewIndexFn;
//# sourceMappingURL=build-map-view-index-fn.js.map