bleh
This commit is contained in:
parent
5cf42e538c
commit
45e9dd43e4
@ -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;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user