(domainId: string, docType: K, docId: DocType[K]['docId'], projection?: Projection<DocType[K]>)
| 90 | } |
| 91 | |
| 92 | export async function get<K extends keyof DocType>(domainId: string, docType: K, docId: DocType[K]['docId'], projection?: Projection<DocType[K]>) { |
| 93 | let cursor = coll.find({ domainId, docType, docId }).limit(1); |
| 94 | if (projection) cursor = cursor.project(buildProjection(projection)); |
| 95 | const result = await cursor.toArray(); |
| 96 | if (result.length) return result[0]; |
| 97 | return null; |
| 98 | } |
| 99 | |
| 100 | export async function set<K extends keyof DocType>( |
| 101 | domainId: string, |
nothing calls this directly
no test coverage detected