mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
core: update to mongodb5 (#514)
This commit is contained in:
1 parent
5a02010120
commit
0685b88066
59 files changed
+610
-601
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user