core: 速度优化:添加problem_list的projection支持

This commit is contained in:
undefined committed 2020-10-22 13:18:31 +08:00
1 parent f78d19bebb
commit 0ed107bbba
8 files changed
+48 -19

No files matched your search

+6
View File
@@ -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;
}