core: update to mongodb5 (#514)

This commit is contained in:
undefined authored and GitHub committed 2023-02-27 18:31:24 +08:00
1 parent 5a02010120
commit 0685b88066
59 files changed
+610 -601

No files matched your search

+3 -3
View File
@@ -1,6 +1,6 @@
export function buildProjection(fields: readonly (string | number)[]): Record<string, 1> {
const o = {};
for (const k of fields) o[k] = 1;
export function buildProjection<T extends string | number = string>(fields: readonly T[]): Record<T, true> {
const o: Record<T, true> = {} as any;
for (const k of fields) o[k] = true;
return o;
}