aboutsummaryrefslogtreecommitdiff
path: root/src/server/MemoryDatabase.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-12-04 17:38:36 -0500
committerbobzel <zzzman@gmail.com>2023-12-04 17:38:36 -0500
commit2bd239e39264a362d1fbb013ce2613d03247d78e (patch)
tree6e537dc0c35529c6ee27758a4dec03e23210dbc6 /src/server/MemoryDatabase.ts
parentcf7a7dc34426dacf018ac98a83a9589106ae7256 (diff)
trying to do version updates on all npm packages.
Diffstat (limited to 'src/server/MemoryDatabase.ts')
-rw-r--r--src/server/MemoryDatabase.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/MemoryDatabase.ts b/src/server/MemoryDatabase.ts
index d2d8bb3b3..b74332bf5 100644
--- a/src/server/MemoryDatabase.ts
+++ b/src/server/MemoryDatabase.ts
@@ -19,7 +19,7 @@ export class MemoryDatabase implements IDatabase {
return Promise.resolve(Object.keys(this.db));
}
- public update(id: string, value: any, callback: (err: mongodb.MongoError, res: mongodb.UpdateWriteOpResult) => void, _upsert?: boolean, collectionName = DocumentsCollection): Promise<void> {
+ public update(id: string, value: any, callback: (err: mongodb.MongoError, res: mongodb.UpdateResult) => void, _upsert?: boolean, collectionName = DocumentsCollection): Promise<void> {
const collection = this.getCollection(collectionName);
const set = "$set";
if (set in value) {
@@ -45,17 +45,17 @@ export class MemoryDatabase implements IDatabase {
return Promise.resolve(undefined);
}
- public updateMany(query: any, update: any, collectionName = DocumentsCollection): Promise<mongodb.WriteOpResult> {
+ public updateMany(query: any, update: any, collectionName = DocumentsCollection): Promise<mongodb.UpdateResult> {
throw new Error("Can't updateMany a MemoryDatabase");
}
- public replace(id: string, value: any, callback: (err: mongodb.MongoError, res: mongodb.UpdateWriteOpResult) => void, upsert?: boolean, collectionName = DocumentsCollection): void {
+ public replace(id: string, value: any, callback: (err: mongodb.MongoError, res: mongodb.UpdateResult) => void, upsert?: boolean, collectionName = DocumentsCollection): void {
this.update(id, value, callback, upsert, collectionName);
}
- public delete(query: any, collectionName?: string): Promise<mongodb.DeleteWriteOpResultObject>;
- public delete(id: string, collectionName?: string): Promise<mongodb.DeleteWriteOpResultObject>;
- public delete(id: any, collectionName = DocumentsCollection): Promise<mongodb.DeleteWriteOpResultObject> {
+ public delete(query: any, collectionName?: string): Promise<mongodb.DeleteResult>;
+ public delete(id: string, collectionName?: string): Promise<mongodb.DeleteResult>;
+ public delete(id: any, collectionName = DocumentsCollection): Promise<mongodb.DeleteResult> {
const i = id.id ?? id;
delete this.getCollection(collectionName)[i];
@@ -105,7 +105,7 @@ export class MemoryDatabase implements IDatabase {
}
}
- public query(): Promise<mongodb.Cursor> {
+ public query(): Promise<mongodb.FindCursor> {
throw new Error("Can't query a MemoryDatabase");
}
}