aboutsummaryrefslogtreecommitdiff
path: root/src/server/MemoryDatabase.ts
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2024-09-05 11:40:24 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2024-09-05 11:40:24 -0400
commitc1053475810a1b1b3a9963c3f1ef0b1a9509d222 (patch)
tree41da9f26592ba7f189f8d00536435182e38272da /src/server/MemoryDatabase.ts
parent785e55141cab178a761080f5c99384bb19855969 (diff)
parent9014cc474a039f0daef6cc0ee2011329da7703ac (diff)
merged with master
Diffstat (limited to 'src/server/MemoryDatabase.ts')
-rw-r--r--src/server/MemoryDatabase.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/MemoryDatabase.ts b/src/server/MemoryDatabase.ts
index 1432d91c4..b838cb61b 100644
--- a/src/server/MemoryDatabase.ts
+++ b/src/server/MemoryDatabase.ts
@@ -1,6 +1,6 @@
import * as mongodb from 'mongodb';
+import { serializedDoctype } from '../fields/ObjectField';
import { DocumentsCollection, IDatabase } from './IDatabase';
-import { Transferable } from './Message';
export class MemoryDatabase implements IDatabase {
private db: { [collectionName: string]: { [id: string]: any } } = {};
@@ -81,10 +81,10 @@ export class MemoryDatabase implements IDatabase {
return Promise.resolve();
}
- public getDocument(id: string, fn: (result?: Transferable) => void, collectionName = DocumentsCollection): void {
+ public getDocument(id: string, fn: (result?: serializedDoctype) => void, collectionName = DocumentsCollection): void {
fn(this.getCollection(collectionName)[id]);
}
- public getDocuments(ids: string[], fn: (result: Transferable[]) => void, collectionName = DocumentsCollection): void {
+ public getDocuments(ids: string[], fn: (result: serializedDoctype[]) => void, collectionName = DocumentsCollection): void {
fn(ids.map(id => this.getCollection(collectionName)[id]));
}