@eeplatform/core 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.js +13 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -27167,26 +27167,17 @@ function useBuildingRepo() {
|
|
|
27167
27167
|
const namespace_collection = "school.buildings";
|
|
27168
27168
|
const collection = db.collection(namespace_collection);
|
|
27169
27169
|
const { getCache, setCache, delNamespace } = useCache20(namespace_collection);
|
|
27170
|
-
async function
|
|
27170
|
+
async function createIndexes() {
|
|
27171
27171
|
try {
|
|
27172
|
-
await collection.
|
|
27173
|
-
{ name: 1 },
|
|
27174
|
-
{ school: 1 },
|
|
27175
|
-
{
|
|
27172
|
+
await collection.createIndexes([
|
|
27173
|
+
{ key: { name: 1 }, unique: true, name: "unique_name_index" },
|
|
27174
|
+
{ key: { school: 1 } },
|
|
27175
|
+
{ key: { status: 1 } }
|
|
27176
27176
|
]);
|
|
27177
27177
|
} catch (error) {
|
|
27178
27178
|
throw new Error("Failed to create index on buildings.");
|
|
27179
27179
|
}
|
|
27180
27180
|
}
|
|
27181
|
-
async function createTextIndex() {
|
|
27182
|
-
try {
|
|
27183
|
-
await collection.createIndex({
|
|
27184
|
-
name: "text"
|
|
27185
|
-
});
|
|
27186
|
-
} catch (error) {
|
|
27187
|
-
throw new Error("Failed to create text index on building name.");
|
|
27188
|
-
}
|
|
27189
|
-
}
|
|
27190
27181
|
async function add(value, session) {
|
|
27191
27182
|
try {
|
|
27192
27183
|
value = MBuilding(value);
|
|
@@ -27386,8 +27377,7 @@ function useBuildingRepo() {
|
|
|
27386
27377
|
});
|
|
27387
27378
|
}
|
|
27388
27379
|
return {
|
|
27389
|
-
|
|
27390
|
-
createTextIndex,
|
|
27380
|
+
createIndexes,
|
|
27391
27381
|
add,
|
|
27392
27382
|
getAll,
|
|
27393
27383
|
getById,
|
|
@@ -27416,9 +27406,14 @@ function useBuildingUnitRepo() {
|
|
|
27416
27406
|
const namespace_collection = "school.building-units";
|
|
27417
27407
|
const collection = db.collection(namespace_collection);
|
|
27418
27408
|
const { getCache, setCache, delNamespace } = useCache21(namespace_collection);
|
|
27419
|
-
async function
|
|
27409
|
+
async function createIndexes() {
|
|
27420
27410
|
try {
|
|
27421
27411
|
await collection.createIndexes([
|
|
27412
|
+
{
|
|
27413
|
+
key: { name: 1, building: 1, level: 1 },
|
|
27414
|
+
unique: true,
|
|
27415
|
+
name: "unique_name_index"
|
|
27416
|
+
},
|
|
27422
27417
|
{ key: { school: 1 } },
|
|
27423
27418
|
{ key: { building: 1 } },
|
|
27424
27419
|
{ key: { status: 1 } },
|
|
@@ -27737,7 +27732,7 @@ function useBuildingUnitRepo() {
|
|
|
27737
27732
|
}
|
|
27738
27733
|
}
|
|
27739
27734
|
return {
|
|
27740
|
-
|
|
27735
|
+
createIndexes,
|
|
27741
27736
|
add,
|
|
27742
27737
|
getAll,
|
|
27743
27738
|
getById,
|