mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 速度优化:添加problem_list的projection支持
This commit is contained in:
1 parent
f78d19bebb
commit
0ed107bbba
8 files changed
+48
-19
No files matched your search
@@ -179,3 +179,9 @@ export function streamToBuffer(stream): Promise<Buffer> {
|
||||
stream.on('end', () => resolve(Buffer.concat(buffers)));
|
||||
});
|
||||
}
|
||||
|
||||
export function buildProjection(fields: string[]): Record<string, 1> {
|
||||
const o = {};
|
||||
for (const k of fields) o[k] = 1;
|
||||
return o;
|
||||
}
|
||||
Reference in new issue
Block a user