mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
remove ensureindex api (use postInit instead)
This commit is contained in:
1 parent
be9d2bffb9
commit
e62e7b49a3
13 files changed
+56
-107
No files matched your search
@@ -328,7 +328,7 @@ export async function revSetStatus(
|
||||
return await collStatus.updateOne(filter, update);
|
||||
}
|
||||
|
||||
export async function ensureIndexes() {
|
||||
async function ensureIndexes() {
|
||||
await coll.createIndex({ domainId: 1, docType: 1, docId: 1 }, { unique: true });
|
||||
await coll.createIndex({
|
||||
domainId: 1, docType: 1, owner: 1, docId: -1,
|
||||
@@ -390,6 +390,7 @@ export async function ensureIndexes() {
|
||||
}, { sparse: true });
|
||||
}
|
||||
|
||||
global.Hydro.postInit.push(ensureIndexes);
|
||||
global.Hydro.model.document = {
|
||||
add,
|
||||
addToSet,
|
||||
@@ -399,7 +400,6 @@ global.Hydro.model.document = {
|
||||
deleteMultiStatus,
|
||||
deleteOne,
|
||||
deleteSub,
|
||||
ensureIndexes,
|
||||
get,
|
||||
getMulti,
|
||||
getMultiStatus,
|
||||
|
||||
Reference in new issue
Block a user