diff options
author | bobzel <zzzman@gmail.com> | 2024-09-02 09:26:37 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-09-02 09:26:37 -0400 |
commit | cda69e48361fce8d71a4dc66edd9dd976a27f52d (patch) | |
tree | 82b9a1a5967ae88a9534f89f7eaed3aeb289652f /src/server/MemoryDatabase.ts | |
parent | c01828308714874589d1f60c33ca59df4c656c0c (diff) | |
parent | a958577d4c27b276aa37484e3f895e196138b17c (diff) |
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/server/MemoryDatabase.ts')
-rw-r--r-- | src/server/MemoryDatabase.ts | 6 |
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])); } |