This commit is contained in:
Erik 2023-04-14 22:21:20 +03:00
parent 5cf42e538c
commit 45e9dd43e4
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68

View File

@ -307,17 +307,17 @@ class MongoDB {
await this.#db.collection(collection).createIndex(indices);
}
async getKey (key: string, collection = 'memoryStore') {
const response = await this.findOne(collection, { key });
if (response)
return response.value;
return null;
}
// async getKey (key: string, collection = 'memoryStore') {
// const response = await this.findOne(collection, { key });
// if (response)
// return response.value;
// return null;
// }
async setKey (key: string, value: object, collection = 'memoryStore') {
await this.updateOne(collection, { key }, { value }, true);
return value;
}
// async setKey (key: string, value: object, collection = 'memoryStore') {
// await this.updateOne(collection, { key }, { value }, true);
// return value;
// }
}