@oridune/epic-odm
Advanced tools
Comparing version 1.0.62 to 1.0.63
{ | ||
"name": "@oridune/epic-odm", | ||
"version": "1.0.62", | ||
"version": "1.0.63", | ||
"description": "Install 1 ODM and code once with any database driver.", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -263,9 +263,19 @@ "use strict"; | ||
if (IndexNames.length) | ||
await collection.createIndexes(IndexNames.map((name) => (Object.assign({ name: `${prefix ? prefix + "." : ""}${name}`, key: Indexes[name].columns.reduce((fields, field) => (Object.assign(Object.assign({}, fields), { [`${prefix ? prefix + "." : ""}${field.replace(/^-/, "")}`]: Indexes[name].type === "text" | ||
? "text" | ||
: /^-/.test(field) | ||
? -1 | ||
: 1 })), {}), unique: Indexes[name].type === "unique", background: true }, (typeof Indexes[name].ttl === "number" | ||
? { expireAfterSeconds: Indexes[name].ttl } | ||
: {}))))); | ||
await collection.createIndexes(IndexNames.map((name) => { | ||
var _a; | ||
const PartialFilters = (_a = Indexes[name].options) === null || _a === void 0 ? void 0 : _a.partialFilterExpression; | ||
return Object.assign(Object.assign({ name: `${prefix ? prefix + "." : ""}${name}`, key: Indexes[name].columns.reduce((fields, field) => (Object.assign(Object.assign({}, fields), { [`${prefix ? prefix + "." : ""}${field.replace(/^-/, "")}`]: Indexes[name].type === "text" | ||
? "text" | ||
: /^-/.test(field) | ||
? -1 | ||
: 1 })), {}), unique: Indexes[name].type === "unique", background: true }, (typeof Indexes[name].ttl === "number" | ||
? { expireAfterSeconds: Indexes[name].ttl } | ||
: {})), (typeof PartialFilters === "object" | ||
? { | ||
partialFilterExpression: TransposeToNative([ | ||
PartialFilters, | ||
])[0], | ||
} | ||
: {})); | ||
})); | ||
}; | ||
@@ -272,0 +282,0 @@ // Syncronization |
@@ -6,2 +6,3 @@ import { BaseModel } from "../model/base"; | ||
import { RelationInterface } from "./relation"; | ||
import { Conditions } from "../model/utils"; | ||
export declare type Indexes = "index" | "unique" | "text"; | ||
@@ -12,2 +13,5 @@ export interface IndexInterface<M extends BaseModel = BaseModel> { | ||
ttl?: number; | ||
options?: { | ||
partialFilterExpression: Conditions<M>; | ||
}; | ||
} | ||
@@ -14,0 +18,0 @@ export interface ModelOptions<M extends BaseModel = BaseModel> { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117994
2462