chore: eslint max-len

This commit is contained in:
Peter Jaszkowiak
2021-02-04 02:07:29 -07:00
committed by Julian Lam
parent 5c2f0f0557
commit cc9d6fd08b
64 changed files with 459 additions and 137 deletions

View File

@@ -95,7 +95,9 @@ module.exports = function (module) {
const batch = require('../../batch');
const batchSize = Math.ceil(key.length / Math.ceil(key.length / 100));
await batch.processArray(key, async currentBatch => batches.push(currentBatch), { batch: batchSize });
const batchData = await Promise.all(batches.map(batch => doQuery({ $in: batch }, { _id: 0, _key: 0 }, 0, stop + 1)));
const batchData = await Promise.all(batches.map(
batch => doQuery({ $in: batch }, { _id: 0, _key: 0 }, 0, stop + 1)
));
result = dbHelpers.mergeBatch(batchData, 0, stop, sort);
if (start > 0) {
result = result.slice(start, stop !== -1 ? stop + 1 : undefined);

View File

@@ -65,7 +65,10 @@ module.exports = function (module) {
const bulk = module.client.collection('objects').initializeUnorderedBulkOp();
for (let i = 0; i < keys.length; i += 1) {
bulk.find({ _key: keys[i], value: value }).upsert().updateOne({ $set: { score: parseFloat(isArrayOfScores ? scores[i] : scores) } });
bulk
.find({ _key: keys[i], value: value })
.upsert()
.updateOne({ $set: { score: parseFloat(isArrayOfScores ? scores[i] : scores) } });
}
await bulk.execute();
};