From 4270637b372d176a2fa62e13532bd2199c7da66b Mon Sep 17 00:00:00 2001 From: Peter Van Drunen Date: Tue, 11 Sep 2018 17:11:03 -0400 Subject: [PATCH 1/7] Initial set up Added an enum for allowed operation types and set up the basic mechanism for running different operations. --- src/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index f9d34b3..b4da977 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,12 @@ import { Writable } from 'stream'; import { MongoClient } from 'mongodb'; +const validOperations = [ + 'insert', + 'update', + 'delete' +]; + module.exports = { streamToMongoDB: (options) => { const config = Object.assign( @@ -8,6 +14,7 @@ module.exports = { { batchSize: 1, insertOptions: { w: 1 }, + operationType: 'insert' }, // overrided options options, @@ -20,7 +27,7 @@ module.exports = { // this function is usefull to insert records and reset the records array const insert = async () => { - await collection.insert(records, config.insertOptions); + await collection[config.operationType + 'Many'](records, config.insertOptions); records = []; }; From aede49af757bab00fdf9e775020a7bc8a464332f Mon Sep 17 00:00:00 2001 From: Peter Van Drunen Date: Tue, 11 Sep 2018 20:40:01 -0400 Subject: [PATCH 2/7] Tests pass for insert Tests that pass on master now pass with the modified API in place. --- src/index.js | 66 +- src/spec/index_spec.js | 74 +- .../support/{data.json => insertData.json} | 0 src/spec/support/updateData.json | 821 ++++++++++++++++++ 4 files changed, 931 insertions(+), 30 deletions(-) rename src/spec/support/{data.json => insertData.json} (100%) create mode 100644 src/spec/support/updateData.json diff --git a/src/index.js b/src/index.js index b4da977..243123b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,63 +1,91 @@ import { Writable } from 'stream'; import { MongoClient } from 'mongodb'; -const validOperations = [ - 'insert', - 'update', - 'delete' -]; - module.exports = { streamToMongoDB: (options) => { const config = Object.assign( // default config { batchSize: 1, - insertOptions: { w: 1 }, operationType: 'insert' }, - // overrided options - options, + // override config + options ); - // those variables can't be initialized without Promises, so we wait first drain + // These variables can't be initialized without Promises, so we wait for the first drain let dbConnection; let collection; let records = []; - // this function is usefull to insert records and reset the records array - const insert = async () => { - await collection[config.operationType + 'Many'](records, config.insertOptions); - records = []; + // Supported operations + const operations = { + insert: async () => { + return collection.insertMany(records) + }, + update: async () => { + // TODO: Find a way to use mongodb's updateMany instead of sending one transaction per record + if (typeof config.indexName === 'undefined') { + return Promise.reject(Error('Operation type was update, but no index was provided.')); + } + + // update each record in tandem. + return Promise.all( records.map((doc) => collection.updateOne({[config.indexName]: r[config.indexName]}, { $set: r })) ); + }, + delete: async () => { /* delete items matching a filter */ }, + invalid: () => { return Promise.reject(Error(`Invalid operation type: ${config.operationType}`)) } + }; + + // Utility for writing to the db with the correct operation + const writeToDB = async () => { + if (Object.keys(operations).includes(config.operationType)) { + try { + return operations[config.operationType](); + } catch (err) { + return operations.invalid(); + } + } else { + // TODO: add some kind of error message for invalid operations + return operations.invalid(); + } }; // stream const writable = new Writable({ objectMode: true, write: async (record, encoding, next) => { + // try/catch for initialization try { // connection if (!dbConnection) dbConnection = await MongoClient.connect(config.dbURL); if (!collection) collection = await dbConnection.collection(config.collection); + } catch (err) { + if (dbConnection) await dbConnection.close(); + writable.emit('Error on db init', err); + } + // try/catch for write operations + try { // add to batch records records.push(record); - // insert and reset batch recors - if (records.length >= config.batchSize) await insert(); + // write and reset batch records + if (records.length >= config.batchSize) { + await writeToDB(); + records = []; + } - // next stream next(); } catch (error) { if (dbConnection) await dbConnection.close(); - writable.emit('error', error); + writable.emit('Error on data write', error); } } }); writable.on('finish', async () => { try { - if (records.length > 0) await insert(); + if (records.length > 0) await writeToDB(); if (dbConnection) await dbConnection.close(); writable.emit('close'); diff --git a/src/spec/index_spec.js b/src/spec/index_spec.js index fb42bf7..3a08d0d 100644 --- a/src/spec/index_spec.js +++ b/src/spec/index_spec.js @@ -5,11 +5,14 @@ import path from 'path'; import JSONStream from 'JSONStream'; import StreamToMongoDB from '../index'; -const DATA_FILE_LOCATION = path.resolve('src/spec/support/data.json'); +const INSERT_DATA_FILE_LOCATION = path.resolve('src/spec/support/insertData.json'); +const UPDATE_DATA_FILE_LOCATION = path.resolve('src/spec/support/updateData.json'); +const UPDATE_DATA_FILE_VALUE = 1337; + const testDB = 'streamToMongoDB'; const config = { dbURL: `mongodb://localhost:27017/${testDB}`, collection: 'test' }; -const expectedNumberOfRecords = require('./support/data.json').length; +const expectedNumberOfRecords = require('./support/insertData.json').length; describe('.streamToMongoDB', () => { beforeEach(async (done) => { @@ -24,29 +27,38 @@ describe('.streamToMongoDB', () => { describe('with no given options', () => { it('it uses the default config to stream the expected number of documents to MongoDB', async (done) => { - runStreamTest(config, done); + runInsertStream(config, done); }); }); - describe('with given options', () => { + describe('inserts with given options', () => { describe('with batchSize same as the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { config.batchSize = expectedNumberOfRecords; - runStreamTest(config, done); + runInsertStream(config, done); }); }); describe('with batchSize less than number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { config.batchSize = expectedNumberOfRecords - 3; - runStreamTest(config, done); + runInsertStream(config, done); }); }); describe('with batchSize more than the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { config.batchSize = expectedNumberOfRecords * 100; - runStreamTest(config, done); + runInsertStream(config, done); + }); + }); + }); + + describe('updates with given options', () => { + describe('with batchSize same as the number of documents to be streamed', () => { + it('it updates all totals to the same value', (done) => { + config.batchSize = expectedNumberOfRecords; + runUpdateStream(config, done); }); }); }); @@ -54,12 +66,12 @@ describe('.streamToMongoDB', () => { const connect = () => MongoDB.MongoClient.connect(config.dbURL); -const runStreamTest = (options, done) => { - fs.createReadStream(DATA_FILE_LOCATION) +const runInsertStream = (config, done) => { + fs.createReadStream(INSERT_DATA_FILE_LOCATION) .pipe(JSONStream.parse('*')) - .pipe(StreamToMongoDB.streamToMongoDB(options)) + .pipe(StreamToMongoDB.streamToMongoDB(config)) .on('error', (err) => { - done(); + done.fail(err); }) .on('close', () => { ensureAllDocumentsInserted(done); @@ -74,6 +86,46 @@ const ensureAllDocumentsInserted = async (done) => { done(); }; +const runUpdateStream = (config, done) => { + fs.createReadStream(INSERT_DATA_FILE_LOCATION) + .pipe(JSONStream.parse('*')) + .pipe(StreamToMongoDB.streamToMongoDB(config)) + .on('error', (err) => { + done.fail(err); + }) + .on('close', () => { + updateAllDocuments(config, done); + }); +}; + +const updateAllDocuments = (config, done) => { + // update every document to have the same total + const options = Object.assign( + {}, + config, + { + operationType: 'update' + } + ); + fs.createReadStream(UPDATE_DATA_FILE_LOCATION) + .pipe(JSONStream.parse('*')) + .pipe(StreamToMongoDB.streamToMongoDB(options)) + .on('error', (err) => { + done.fail(err); + }) + .on('close', () => { + ensureAllDocumentsUpdated(config, done); + }); +}; + +const ensureAllDocumentsUpdated = async (done) => { + const db = await connect(); + const data = await db.collection(config.collection).find({}); + await db.close(); + data.forEach((d) => expect(d.total).toEqual(UPDATE_DATA_FILE_VALUE)); + done(); +}; + const clearDB = async () => { const dbConnection = await connect(); await dbConnection.dropDatabase(); diff --git a/src/spec/support/data.json b/src/spec/support/insertData.json similarity index 100% rename from src/spec/support/data.json rename to src/spec/support/insertData.json diff --git a/src/spec/support/updateData.json b/src/spec/support/updateData.json new file mode 100644 index 0000000..82b9433 --- /dev/null +++ b/src/spec/support/updateData.json @@ -0,0 +1,821 @@ +[ + { "secret": "652e9a9d46c221142fcf855ad55f0887", "total": 1337 }, + { "secret": "62b36ea62533cbaedb46691a7d3af78d", "total": 1337 }, + { "secret": "effd38f806f0538e00c75e6f8533b970", "total": 1337 }, + { "secret": "fa6db1e8eac249d05446193687acd55e", "total": 1337 }, + { "secret": "827b265d9e1743d5ca1cc97f62bd8166", "total": 1337 }, + { "secret": "55ad80831d75b72db4efbfd3e20efcaf", "total": 1337 }, + { "secret": "7a9cfdac4cb4e8a32bdb646f4ac09f31", "total": 1337 }, + { "secret": "e960c20e237b39f7824a19c0c0c518fe", "total": 1337 }, + { "secret": "3828018642196cc4aff41d0adcafe43e", "total": 1337 }, + { "secret": "8fbf99c97085b142aebec354eff3798a", "total": 1337 }, + { "secret": "37dc50d0203ca1ba9548ad9a28769fd2", "total": 1337 }, + { "secret": "0438d18c0062af489e7a95ada8769f7e", "total": 1337 }, + { "secret": "515f7ae8216670facb85f171f2bd716a", "total": 1337 }, + { "secret": "ab2dae116d04efbdb01c4b03af5bab83", "total": 1337 }, + { "secret": "f1d869c4966d7b42a7eb879cdd46666f", "total": 1337 }, + { "secret": "a46a946c7d1358881b027cab52af28c1", "total": 1337 }, + { "secret": "876a25f832a4bb7b1dfce6fb41f34309", "total": 1337 }, + { "secret": "8241014d6bca1344490587afb42a9fff", "total": 1337 }, + { "secret": "6a7a30288ece2c2442f52982c01305b9", "total": 1337 }, + { "secret": "986eda35eaf991175c41b82657c10121", "total": 1337 }, + { "secret": "190c4369c6f5646493007bebec046893", "total": 1337 }, + { "secret": "934a322df7eb8457c6a22c106ad5ba68", "total": 1337 }, + { "secret": "810b54988f27f7f9f49b838e90a407b9", "total": 1337 }, + { "secret": "38ee752481d126e8dd0b8e849836f75a", "total": 1337 }, + { "secret": "a1aee050edfdcee4ae65cff3bfc60ea8", "total": 1337 }, + { "secret": "6eab89aa55a94ef5cc1c10bdc2f2b686", "total": 1337 }, + { "secret": "bb28809091b55278f2c0c1df8bd32895", "total": 1337 }, + { "secret": "5e732a1878be2342dbfeff5fe3ca5aa3", "total": 1337 }, + { "secret": "5766fcfb46a3a82e2c55823305e04c86", "total": 1337 }, + { "secret": "7053a9ff81971092aa4d2d190bbd4ce8", "total": 1337 }, + { "secret": "e62e1bdb203a630bf4661e8ef456956c", "total": 1337 }, + { "secret": "07d4f780e3528db8c539ee5c21fddeae", "total": 1337 }, + { "secret": "307a4b760d05f493863dbdd8f387fd99", "total": 1337 }, + { "secret": "5b02107ca2d0906fbe4d9f612b8160da", "total": 1337 }, + { "secret": "73553dc668de24c7e4b2620cc9123279", "total": 1337 }, + { "secret": "2ef769c85254d9aba16dc5d62c5684d4", "total": 1337 }, + { "secret": "1c42421fe1e7d3b5dbf84fd377473e8d", "total": 1337 }, + { "secret": "2201a28f5d54fa4705b1a57b2404f650", "total": 1337 }, + { "secret": "bc2572d0527073c5fdf3e06a245f5727", "total": 1337 }, + { "secret": "d800f7de040d5f65d3bb720b675dbd99", "total": 1337 }, + { "secret": "b4ba74af6b068d53ed848a43ea68d767", "total": 1337 }, + { "secret": "677e3013dbcd68e35b1bd9a12bdf5070", "total": 1337 }, + { "secret": "4a30a71a1a053495d692dba4db5b3361", "total": 1337 }, + { "secret": "21c57fcccd4274e94b8fd5279d5dc856", "total": 1337 }, + { "secret": "5c1f9bbe155e84e335c8a1a26ac46462", "total": 1337 }, + { "secret": "70e89a1189437bd9bc2c8315cf172c19", "total": 1337 }, + { "secret": "910ad7be44e19257c9a4b90c4098e07e", "total": 1337 }, + { "secret": "30a024b966b392d90a0c2d05e7ec3804", "total": 1337 }, + { "secret": "67ba60cf6eb38e077bfa5bd9e691faef", "total": 1337 }, + { "secret": "196f150fe4c07e24f6acbdf738a1b1fc", "total": 1337 }, + { "secret": "249ba6277758050695e8f5909bacd6d3", "total": 1337 }, + { "secret": "5b02107ca2d0906fbe4d9f612b8160da", "total": 1337 }, + { "secret": "a1ecacc2893c4130fa14d3dfae130c8f", "total": 1337 }, + { "secret": "c5ba8c2ce3e9ad3df4117a8f3ae63eaf", "total": 1337 }, + { "secret": "59d315718351ebbd4334f0609338a1de", "total": 1337 }, + { "secret": "5a5eb2870f01fde7fb3b7bbf7d70ab89", "total": 1337 }, + { "secret": "fcf3d78a118d89ad6e9dcdab40a5a38b", "total": 1337 }, + { "secret": "bbaf54db884d6e7ea9252c44ecb45f54", "total": 1337 }, + { "secret": "b7ab325a77f1ab05a32f9a0e752a1965", "total": 1337 }, + { "secret": "0b76148f385d3b46b8005e202f0d42a0", "total": 1337 }, + { "secret": "82ca471eea853009173af486ed173c07", "total": 1337 }, + { "secret": "5592f5a7e341839192c467a9793f8f1c", "total": 1337 }, + { "secret": "4816b20bbb2673692f5d8327d331fc00", "total": 1337 }, + { "secret": "c9b2821620c187cb37cd4d4b7d3853e1", "total": 1337 }, + { "secret": "b8d8c02f901a44212b06f5b668408927", "total": 1337 }, + { "secret": "af9f61512a7a1ae916fd57a560869902", "total": 1337 }, + { "secret": "5e732a1878be2342dbfeff5fe3ca5aa3", "total": 1337 }, + { "secret": "b73a8afb86d5a4c2523e28938696ed2d", "total": 1337 }, + { "secret": "020c4e72e46f76960fcee2833f65b394", "total": 1337 }, + { "secret": "89e74e640b8c46257a29de0616794d5d", "total": 1337 }, + { "secret": "190c4369c6f5646493007bebec046893", "total": 1337 }, + { "secret": "ab98830f4bee5e6ca25fb9be4699f216", "total": 1337 }, + { "secret": "89e74e640b8c46257a29de0616794d5d", "total": 1337 }, + { "secret": "e29dffb7e136c25dac823fb0f5100a5b", "total": 1337 }, + { "secret": "9d83118f55af029f8ce63d1e91bb6b90", "total": 1337 }, + { "secret": "e9d426b538216ebef592846817a60d58", "total": 1337 }, + { "secret": "ee29089b0631fc1101f3ce1b75e603d4", "total": 1337 }, + { "secret": "5e67892910f48f16d1f1d7019b7ea771", "total": 1337 }, + { "secret": "4ec1586708124cd1652008353281160b", "total": 1337 }, + { "secret": "c7be81a9a6761d5e90a83d48b9fd90a9", "total": 1337 }, + { "secret": "b10d07ceae1b035f21265a24b34d6dc8", "total": 1337 }, + { "secret": "3766b08dfc4a3bfcc680e7df1f51ee05", "total": 1337 }, + { "secret": "e4add7a33e97736ee57712439175dfe3", "total": 1337 }, + { "secret": "05c18ed71bc533e7ae13abfc383d208e", "total": 1337 }, + { "secret": "769f641c508eb1cbd9d2ef1615ffc4f8", "total": 1337 }, + { "secret": "d5e420bcfff7894475e33d569e4a8b64", "total": 1337 }, + { "secret": "1dcdc177cc6d94997b723efe213f9367", "total": 1337 }, + { "secret": "5411914355756de7fc4654a9f7478c8c", "total": 1337 }, + { "secret": "55a54008ad1ba589aa210d2629c1df41", "total": 1337 }, + { "secret": "d4510552688365266d2aa4c276afa3eb", "total": 1337 }, + { "secret": "7b8eaf5c5bc7b2808304629c289ff6d9", "total": 1337 }, + { "secret": "cd14ecc6dadc7a30954ef9c76303a524", "total": 1337 }, + { "secret": "c2c2055d0aceb4ee059add9c8aadfec3", "total": 1337 }, + { "secret": "0f53bb8882cc039da478af8ac75c7017", "total": 1337 }, + { "secret": "1cf20f278886a7d3e58aa12d2ba1e3d8", "total": 1337 }, + { "secret": "2625a9ea180bb5d8cb6e59c26591cb8d", "total": 1337 }, + { "secret": "2c4f44cc6b48e68f97f4e31d714ea926", "total": 1337 }, + { "secret": "d19f2fe67eb6e9eebec53bf3942d9b5f", "total": 1337 }, + { "secret": "5e42cd0c1d4207ce2e4fb03b3648fe34", "total": 1337 }, + { "secret": "e9d426b538216ebef592846817a60d58", "total": 1337 }, + { "secret": "44cc83557943807cc1db6ef4004b1134", "total": 1337 }, + { "secret": "6385caaa3b6d87ae851dd9f796c0ea69", "total": 1337 }, + { "secret": "bf63a653c3b6442fcacd82d96ff620a1", "total": 1337 }, + { "secret": "44cc83557943807cc1db6ef4004b1134", "total": 1337 }, + { "secret": "a1ecacc2893c4130fa14d3dfae130c8f", "total": 1337 }, + { "secret": "a77c4f948d93d1f5161391136cac908b", "total": 1337 }, + { "secret": "0438d18c0062af489e7a95ada8769f7e", "total": 1337 }, + { "secret": "09960d18c947355e0b797d2c266e0825", "total": 1337 }, + { "secret": "ea1d00c87efbe3be913d70587320e3e8", "total": 1337 }, + { "secret": "cd138ef774e7e469ddcdb0c82083cdf9", "total": 1337 }, + { "secret": "806fb4a8c3268a04047710a67a0df739", "total": 1337 }, + { "secret": "fd76b75624bd226c039768f242ae8cff", "total": 1337 }, + { "secret": "1af31cc69182179c5da3a05c7bc0f62d", "total": 1337 }, + { "secret": "8ce586ae9af76685c2e78e80667909e9", "total": 1337 }, + { "secret": "b21ab08a29b85ef9ea7fd82df2b87e9f", "total": 1337 }, + { "secret": "eeb0805e8a14f53feaabb6e7679b3cb4", "total": 1337 }, + { "secret": "41551c9cfd7ba9a52c38040aa6945177", "total": 1337 }, + { "secret": "04d66382cf969fa4defdeb4b844b3ee2", "total": 1337 }, + { "secret": "05c18ed71bc533e7ae13abfc383d208e", "total": 1337 }, + { "secret": "09960d18c947355e0b797d2c266e0825", "total": 1337 }, + { "secret": "c1264b165b0e029d9d49ae2e2af66821", "total": 1337 }, + { "secret": "1af31cc69182179c5da3a05c7bc0f62d", "total": 1337 }, + { "secret": "d4e58633f8516a29b47d7cfd4dd8beef", "total": 1337 }, + { "secret": "c3a5ddccecc60b3dfb53aadaf6c89d3c", "total": 1337 }, + { "secret": "66c12c9872ccbe669f570a45170f7b41", "total": 1337 }, + { "secret": "7bffed2808dfba7915f89f8f42b09f83", "total": 1337 }, + { "secret": "5e42cd0c1d4207ce2e4fb03b3648fe34", "total": 1337 }, + { "secret": "dc01182b995bdc48aafa583b71ef5fe0", "total": 1337 }, + { "secret": "ee955a30a583247de7da2af0d1bc4f28", "total": 1337 }, + { "secret": "b9d723714d187d970a01ca5fcef8c439", "total": 1337 }, + { "secret": "0b69b093d7b8cdabab64719d7016f6c1", "total": 1337 }, + { "secret": "07d4f780e3528db8c539ee5c21fddeae", "total": 1337 }, + { "secret": "85f1d937567c86d20e82870a6620da31", "total": 1337 }, + { "secret": "bf22b4a95826a7e408923105f2c61241", "total": 1337 }, + { "secret": "8925b7ae79e21bdef1b21b166415d5fb", "total": 1337 }, + { "secret": "dfcb813d6c003fb3e2fca9f5295e9f58", "total": 1337 }, + { "secret": "6b2c74005056c043fb8b5c44f3ab9b4b", "total": 1337 }, + { "secret": "7ab0ead7327935b02d30e46e550ac843", "total": 1337 }, + { "secret": "48485b6f4f5373601aba8d1a6b526cf7", "total": 1337 }, + { "secret": "e4605550728c604744c16594e5960c55", "total": 1337 }, + { "secret": "9e51740711f1f539aefef82bb89a9822", "total": 1337 }, + { "secret": "9d5c409abdaef1cdf8584078cb4886b7", "total": 1337 }, + { "secret": "809c2f4a058f0d6d9524b29e698c0ad8", "total": 1337 }, + { "secret": "e9aa815b69b1c76e4b4e12c68fb5e84a", "total": 1337 }, + { "secret": "827b265d9e1743d5ca1cc97f62bd8166", "total": 1337 }, + { "secret": "515f7ae8216670facb85f171f2bd716a", "total": 1337 }, + { "secret": "a6d217f5616d76a7511df144b776a0d1", "total": 1337 }, + { "secret": "42741ab3c3ae177d1d1caaab4c84fcaf", "total": 1337 }, + { "secret": "22233416321987e377230ef8b112bd9c", "total": 1337 }, + { "secret": "685bb8fe18d1981d9246676d553e496e", "total": 1337 }, + { "secret": "29798ff6a82107db17f5956ccef0f9c8", "total": 1337 }, + { "secret": "d771bc3c1b5d5d5111328423600c60bb", "total": 1337 }, + { "secret": "92ca13cfa0db1c9db660ee0e7f4f3220", "total": 1337 }, + { "secret": "a9f59ede5d74d8b22687c1976aa6d3ca", "total": 1337 }, + { "secret": "7f3f475c2226024677d239d6580b3a0d", "total": 1337 }, + { "secret": "3d5b6e5376e3e5f04c0ee59c9a81bedf", "total": 1337 }, + { "secret": "876a25f832a4bb7b1dfce6fb41f34309", "total": 1337 }, + { "secret": "934a322df7eb8457c6a22c106ad5ba68", "total": 1337 }, + { "secret": "87b9328494d614148e758384c85312b2", "total": 1337 }, + { "secret": "b45f432ab28d3501db17cf5b508ec8a4", "total": 1337 }, + { "secret": "7aaacd820965ef78133b6b3a36f00189", "total": 1337 }, + { "secret": "fba282cd5faca1f7619e4b7969a27f66", "total": 1337 }, + { "secret": "5e732a1878be2342dbfeff5fe3ca5aa3", "total": 1337 }, + { "secret": "069eb5bf493e95171f4e1accb12ed3d6", "total": 1337 }, + { "secret": "5eedbebd290f47de4c8879ef2f25190b", "total": 1337 }, + { "secret": "3380309c7bd60dd52c4db33d50dc501f", "total": 1337 }, + { "secret": "c38e41cf880623cec59807a858865ee9", "total": 1337 }, + { "secret": "843d071a40ade2f810c5a1d1b0fdf814", "total": 1337 }, + { "secret": "2b24c63023dcefcce49c2c7fdeaf1a51", "total": 1337 }, + { "secret": "bff295006b45bc0de84ad08e3b36a399", "total": 1337 }, + { "secret": "52011b773ca5047d3c6c60a7ed16712e", "total": 1337 }, + { "secret": "8adcff0a6122be74cfe201b1e87ad83c", "total": 1337 }, + { "secret": "2fd9d0f622bab4400a22124f4a09a39d", "total": 1337 }, + { "secret": "b3fae59298e19b2055175587fb614ccb", "total": 1337 }, + { "secret": "126d8412d6e97cd524cd467f45c36640", "total": 1337 }, + { "secret": "1ae5ac9780e772580540c6ac9552f511", "total": 1337 }, + { "secret": "6c7826631b2461a464cb6b92b9f90403", "total": 1337 }, + { "secret": "a8aa8745df55658025f1cff1aa08be70", "total": 1337 }, + { "secret": "ddc36dd52a77bec13a79266393aa52dd", "total": 1337 }, + { "secret": "70f24df82b635129b05e909f1252a2fb", "total": 1337 }, + { "secret": "6972ad17d5c923ae1df0cdc021b7ecc4", "total": 1337 }, + { "secret": "1078bb234dba3986647ea3e14ba2bfbd", "total": 1337 }, + { "secret": "630f826e1097fa6e520acd8907a8183c", "total": 1337 }, + { "secret": "a3b577f5d19e7316b83205be33340d16", "total": 1337 }, + { "secret": "eb5627726d6b695bd0f6a4ca639d96f3", "total": 1337 }, + { "secret": "77c5f5752730770277fe94030b74f37f", "total": 1337 }, + { "secret": "03a3bf159d76033999078d5074084c5f", "total": 1337 }, + { "secret": "726f692ca9e945c115cec3251980b3e0", "total": 1337 }, + { "secret": "1cf20f278886a7d3e58aa12d2ba1e3d8", "total": 1337 }, + { "secret": "dfcdd6916f2e9e64aa37958a2ffbb44a", "total": 1337 }, + { "secret": "ccf2775035946698557437f45feed1b7", "total": 1337 }, + { "secret": "85f1d937567c86d20e82870a6620da31", "total": 1337 }, + { "secret": "066858618b356a50d2a1a85bbc032985", "total": 1337 }, + { "secret": "42741ab3c3ae177d1d1caaab4c84fcaf", "total": 1337 }, + { "secret": "706acf3204a3d094942c7bc49eba2aa8", "total": 1337 }, + { "secret": "eeb0805e8a14f53feaabb6e7679b3cb4", "total": 1337 }, + { "secret": "718687883f58ab40d7f429024539a423", "total": 1337 }, + { "secret": "ce71e4c31ad42a5dae5c0d61b2e9aec7", "total": 1337 }, + { "secret": "15cdebdfacf9701d9adc49e00475ce47", "total": 1337 }, + { "secret": "589016850e76c84a45c41a474c99fa82", "total": 1337 }, + { "secret": "31540cf0b21cd8513d3dbc7192d8cad1", "total": 1337 }, + { "secret": "20f9aa7c189af6e641a43669bebf1c63", "total": 1337 }, + { "secret": "66b0ba248830ddc8c8f84ecf0813536f", "total": 1337 }, + { "secret": "6c7826631b2461a464cb6b92b9f90403", "total": 1337 }, + { "secret": "b55df7fe0d0ec6e9d3c3d74a06f4faf1", "total": 1337 }, + { "secret": "c1f14cfd5d4475b213937bd7a789e47d", "total": 1337 }, + { "secret": "a1aee050edfdcee4ae65cff3bfc60ea8", "total": 1337 }, + { "secret": "ac1fc7bd9ff6a4d1aba624a63aed8c84", "total": 1337 }, + { "secret": "ac91f50de4e17caaf5d9ab30761e43e8", "total": 1337 }, + { "secret": "8bb6c17838643f9691cc6a4de6c51709", "total": 1337 }, + { "secret": "b0d829c5412aac684be1c25b928ccf62", "total": 1337 }, + { "secret": "c89611a6856772647ce1d03ba1d45041", "total": 1337 }, + { "secret": "a1aee050edfdcee4ae65cff3bfc60ea8", "total": 1337 }, + { "secret": "a38c3ccc9a819a84880bbed75951ac39", "total": 1337 }, + { "secret": "9f20e9d0a3a023b8ebc6541af4557e0d", "total": 1337 }, + { "secret": "5e732a1878be2342dbfeff5fe3ca5aa3", "total": 1337 }, + { "secret": "042f7301c555f92b96f34a22acc07ecf", "total": 1337 }, + { "secret": "81fab34eb4238c9fca1e48fc8842f58d", "total": 1337 }, + { "secret": "8e878ff157373db28c4f09339831113b", "total": 1337 }, + { "secret": "3e27adda0aeb73da935204d9d84e0b74", "total": 1337 }, + { "secret": "a83e33f5146fae45dcc9ca6c38760bb2", "total": 1337 }, + { "secret": "8c4f2c0a349409691eabd6e452ae7de7", "total": 1337 }, + { "secret": "0ce0d1cd996c91ed22dead00174471c2", "total": 1337 }, + { "secret": "d19f2fe67eb6e9eebec53bf3942d9b5f", "total": 1337 }, + { "secret": "87a91ecdfa376f52a27788cbdb528704", "total": 1337 }, + { "secret": "7c90ac62b5ba810ccf5c7e6d8b3e4924", "total": 1337 }, + { "secret": "706acf3204a3d094942c7bc49eba2aa8", "total": 1337 }, + { "secret": "00f5a6dffdebedb6f98a4e575e0e6464", "total": 1337 }, + { "secret": "8e9387cf50cd5b93fed7855dc47fc450", "total": 1337 }, + { "secret": "57db60e93fb52657521f8f99cbc7398f", "total": 1337 }, + { "secret": "3828018642196cc4aff41d0adcafe43e", "total": 1337 }, + { "secret": "740ea5cbcea45d751032b960cc041819", "total": 1337 }, + { "secret": "4f1fd2030febf5e4beefd8ec6669eafa", "total": 1337 }, + { "secret": "677e3013dbcd68e35b1bd9a12bdf5070", "total": 1337 }, + { "secret": "2bdd85d4df2e2a9b1ad9d8faff5f24bb", "total": 1337 }, + { "secret": "f80e1e880927fd7cc0dc09a69935fb74", "total": 1337 }, + { "secret": "26e946cf22108ac825f509dd448b5bd2", "total": 1337 }, + { "secret": "784fd054301106e1679454fc0e7d9217", "total": 1337 }, + { "secret": "d4e58633f8516a29b47d7cfd4dd8beef", "total": 1337 }, + { "secret": "020c4e72e46f76960fcee2833f65b394", "total": 1337 }, + { "secret": "361e265bca93633a1fbafde0d2d42b72", "total": 1337 }, + { "secret": "c1e390cae9548b9eaec12c6c6c011677", "total": 1337 }, + { "secret": "f8821c1329772bac7c7b44ec8ddecee3", "total": 1337 }, + { "secret": "515f7ae8216670facb85f171f2bd716a", "total": 1337 }, + { "secret": "ee955a30a583247de7da2af0d1bc4f28", "total": 1337 }, + { "secret": "23ab995e980e397f5c95835f1ac979c5", "total": 1337 }, + { "secret": "5110cd0fadaee9a2c829fa6be4c16bf9", "total": 1337 }, + { "secret": "ec7f7e7bb43742ce868145f71d37b53c", "total": 1337 }, + { "secret": "22233416321987e377230ef8b112bd9c", "total": 1337 }, + { "secret": "f400e5c938fbf99d3d86a53b9af31939", "total": 1337 }, + { "secret": "b9d723714d187d970a01ca5fcef8c439", "total": 1337 }, + { "secret": "dd8c7fa10bff8d316150f2abd0e265f4", "total": 1337 }, + { "secret": "a5188ea631be01aaefd6dae0ee48a7f2", "total": 1337 }, + { "secret": "50db8c0878037e4f2e594188ba0cb033", "total": 1337 }, + { "secret": "88b0c0e58cf001f41945f680669e7d12", "total": 1337 }, + { "secret": "bd967e9e5344ec08f4e06bceb02aec0f", "total": 1337 }, + { "secret": "89fb1d2866979b931c4044c633e3b442", "total": 1337 }, + { "secret": "5c8381ee06a41467d02ea3772b502f26", "total": 1337 }, + { "secret": "ededb41b44759bf4aeec2399b463ddff", "total": 1337 }, + { "secret": "a68e54313b405840c028e070348c1ab6", "total": 1337 }, + { "secret": "58a8bc17edd11cd37c7956823c5e6c3d", "total": 1337 }, + { "secret": "fd930df70b98acbb3cf646e2e8ef1185", "total": 1337 }, + { "secret": "6c7826631b2461a464cb6b92b9f90403", "total": 1337 }, + { "secret": "d68f6e4e01cb1f66ad92bfac36ca7656", "total": 1337 }, + { "secret": "9e084bd809b6d8843b02cb0257b4c558", "total": 1337 }, + { "secret": "67b2885beaf6dad6d518626ecd3ef46d", "total": 1337 }, + { "secret": "b6d087c5f8980ed7b6e35e096852f55f", "total": 1337 }, + { "secret": "89fb1d2866979b931c4044c633e3b442", "total": 1337 }, + { "secret": "eb78f660ed6774af47b4d76603f888cc", "total": 1337 }, + { "secret": "296229166e55508f0965e9f0d8c6c9d8", "total": 1337 }, + { "secret": "5c33f9a44793936ab07e32d91f9908af", "total": 1337 }, + { "secret": "690570f10e1ebda710956adec5bc3481", "total": 1337 }, + { "secret": "90d568d358c32363d4e729e093eecb6c", "total": 1337 }, + { "secret": "307a4b760d05f493863dbdd8f387fd99", "total": 1337 }, + { "secret": "2ca267fef3aa1e70e699504155e42410", "total": 1337 }, + { "secret": "a867f6e8ebd4e3a90c6084c9738b506b", "total": 1337 }, + { "secret": "249ba6277758050695e8f5909bacd6d3", "total": 1337 }, + { "secret": "8e878ff157373db28c4f09339831113b", "total": 1337 }, + { "secret": "8dc1d9a2159ca89dbd7e5c185e6aa132", "total": 1337 }, + { "secret": "a9dbd9f32ca0f65d3132adac27137447", "total": 1337 }, + { "secret": "33ab7d4a21147ebf50b58cb081ce805f", "total": 1337 }, + { "secret": "56a2f807fb2b733d04da71743468df5f", "total": 1337 }, + { "secret": "6d12a24959ae47f8e15ee8a89e07d0c2", "total": 1337 }, + { "secret": "d90553e33ad99a71dbc860452fd6d5a3", "total": 1337 }, + { "secret": "2e83a06d85e2fc8dd5c7898337cd193b", "total": 1337 }, + { "secret": "9d5c409abdaef1cdf8584078cb4886b7", "total": 1337 }, + { "secret": "bff295006b45bc0de84ad08e3b36a399", "total": 1337 }, + { "secret": "d4d9e2fb5e2c48d671fbc59cbfc689cd", "total": 1337 }, + { "secret": "6668c77143a8ddb191753f8655e194eb", "total": 1337 }, + { "secret": "76e2f3fdd22fdccb0c1a52dc78d8e427", "total": 1337 }, + { "secret": "8df122dffc3195150329b20a93c673d9", "total": 1337 }, + { "secret": "d1159ea56ce4a31eaf7c57191fd08caf", "total": 1337 }, + { "secret": "2159d018782c6c93dda7ab55fcae7435", "total": 1337 }, + { "secret": "5eedbebd290f47de4c8879ef2f25190b", "total": 1337 }, + { "secret": "0fedc5a6e1c219abf29bdcd7fa8089c1", "total": 1337 }, + { "secret": "9d83118f55af029f8ce63d1e91bb6b90", "total": 1337 }, + { "secret": "bff295006b45bc0de84ad08e3b36a399", "total": 1337 }, + { "secret": "12f023f06e7ec12986f1ff0a2e26188e", "total": 1337 }, + { "secret": "8100978d6a578cfc7aaae8985ef52ba6", "total": 1337 }, + { "secret": "3380309c7bd60dd52c4db33d50dc501f", "total": 1337 }, + { "secret": "87b9328494d614148e758384c85312b2", "total": 1337 }, + { "secret": "0f53bb8882cc039da478af8ac75c7017", "total": 1337 }, + { "secret": "d4cdb8e9b7fb58a7baaba746deee3d03", "total": 1337 }, + { "secret": "b4ba74af6b068d53ed848a43ea68d767", "total": 1337 }, + { "secret": "3ceeb60b36bcc2114d07065f22300576", "total": 1337 }, + { "secret": "8030b3dcdd08a28c2aaca1d6ea25053d", "total": 1337 }, + { "secret": "6daaed5daabb5cbf4ce95697b142dc75", "total": 1337 }, + { "secret": "581196f156c4a265f07520850ca796ee", "total": 1337 }, + { "secret": "603a0053444b71ed07873c58ab758484", "total": 1337 }, + { "secret": "66c12c9872ccbe669f570a45170f7b41", "total": 1337 }, + { "secret": "fca7372468fa0e0689f54cd21fd653be", "total": 1337 }, + { "secret": "b9daf720c04f7f9ff186f7e2815326ed", "total": 1337 }, + { "secret": "26eb3922f3d8f54f63d222e0f741014f", "total": 1337 }, + { "secret": "6c7b97f129d6351363c6dfb0a88b879b", "total": 1337 }, + { "secret": "9b56db666e5f4d6a8fe0d5c19d243b0b", "total": 1337 }, + { "secret": "005d3c812c2c037e9b0b48c0bf1b642a", "total": 1337 }, + { "secret": "2cdf6f54393da7af3938f95beec4d71a", "total": 1337 }, + { "secret": "b6d087c5f8980ed7b6e35e096852f55f", "total": 1337 }, + { "secret": "40dc6a5c2bdd36b467681f85b0a51b4d", "total": 1337 }, + { "secret": "5c8381ee06a41467d02ea3772b502f26", "total": 1337 }, + { "secret": "9169714479bcb89af9639113a907ff5e", "total": 1337 }, + { "secret": "8a03b1835a4ca1f5c30a007226df6e87", "total": 1337 }, + { "secret": "4828a5e90bdcc9f105c260dbeb8eb02d", "total": 1337 }, + { "secret": "38905ad86a9250e51d75393d12f7db96", "total": 1337 }, + { "secret": "ac2bfee68b9182158d1c5bab47effd65", "total": 1337 }, + { "secret": "1ae5ac9780e772580540c6ac9552f511", "total": 1337 }, + { "secret": "647235f6cd73cb3f6bec50adf8d6b958", "total": 1337 }, + { "secret": "5ba3c0e9bc8d7a62878a74b74520fce8", "total": 1337 }, + { "secret": "d264cac63c524837e711ace9ab7dab7b", "total": 1337 }, + { "secret": "251c1fa8a1e95434a64dce0d4826443e", "total": 1337 }, + { "secret": "126d8412d6e97cd524cd467f45c36640", "total": 1337 }, + { "secret": "a2ba1a8c2e2380851a02e4aaff828e69", "total": 1337 }, + { "secret": "00fdf875daea8f6b1f0e6303418aa59e", "total": 1337 }, + { "secret": "126d8412d6e97cd524cd467f45c36640", "total": 1337 }, + { "secret": "020c4e72e46f76960fcee2833f65b394", "total": 1337 }, + { "secret": "8666683506aacd900bbd5a74ac4edf68", "total": 1337 }, + { "secret": "70c24dfd17decbe5c913aaa4e3c169d4", "total": 1337 }, + { "secret": "306a937c802ddc7d1387b0f87ba00e7f", "total": 1337 }, + { "secret": "6134572a3b3ff084b05fa3397ab6afa2", "total": 1337 }, + { "secret": "89e74e640b8c46257a29de0616794d5d", "total": 1337 }, + { "secret": "069eb5bf493e95171f4e1accb12ed3d6", "total": 1337 }, + { "secret": "fa6db1e8eac249d05446193687acd55e", "total": 1337 }, + { "secret": "6f158cd6f06586a0fb536de8ba9b6a53", "total": 1337 }, + { "secret": "3def3dd56bfbfcc8926f000c9dd42eb0", "total": 1337 }, + { "secret": "fd814f06e1fc3b21d5bffa6bbb7eb534", "total": 1337 }, + { "secret": "1078bb234dba3986647ea3e14ba2bfbd", "total": 1337 }, + { "secret": "6134572a3b3ff084b05fa3397ab6afa2", "total": 1337 }, + { "secret": "8e8daa94d92e601f53280333d9bbb43a", "total": 1337 }, + { "secret": "9e688c58a5487b8eaf69c9e1005ad0bf", "total": 1337 }, + { "secret": "5766fcfb46a3a82e2c55823305e04c86", "total": 1337 }, + { "secret": "51f7be97050848765c86f5acae18a809", "total": 1337 }, + { "secret": "604dd62dfeba49338b31ff80d305cd34", "total": 1337 }, + { "secret": "aefa6760a25e2946fdb215eb2e15055f", "total": 1337 }, + { "secret": "1d1e3e5d3735c46d1a0ea04e225b963f", "total": 1337 }, + { "secret": "e221e4360cb6712301893b55fe06bc44", "total": 1337 }, + { "secret": "40dc6a5c2bdd36b467681f85b0a51b4d", "total": 1337 }, + { "secret": "73d0a7b3fab51beeee8ba428b9cd1d47", "total": 1337 }, + { "secret": "62b36ea62533cbaedb46691a7d3af78d", "total": 1337 }, + { "secret": "a2ba1a8c2e2380851a02e4aaff828e69", "total": 1337 }, + { "secret": "b9d723714d187d970a01ca5fcef8c439", "total": 1337 }, + { "secret": "b8a039b30f6618392f6d570e67f3b241", "total": 1337 }, + { "secret": "be7fc39360eac2ea9a4a1bbc7075dc6c", "total": 1337 }, + { "secret": "08d12ed160c5b7b24eee378f66b72aaa", "total": 1337 }, + { "secret": "5aec2a4511adb5683175573c4a1bb314", "total": 1337 }, + { "secret": "a9fc9e1accf07bb324d7da539a90c8cc", "total": 1337 }, + { "secret": "23807b2eeb6719d64829a1b2b88682de", "total": 1337 }, + { "secret": "8c243d0b6cdf7d3f847b15a27bb51ba8", "total": 1337 }, + { "secret": "7a9cfdac4cb4e8a32bdb646f4ac09f31", "total": 1337 }, + { "secret": "70c24dfd17decbe5c913aaa4e3c169d4", "total": 1337 }, + { "secret": "067b10e879774e103c87b89522f37c61", "total": 1337 }, + { "secret": "6264a30ebd7d7c8e62f4981f64601d33", "total": 1337 }, + { "secret": "4dfb0bd50fd1e342a2e28b687799a011", "total": 1337 }, + { "secret": "2f4c8b6065fbb88771654fc16f8a7e94", "total": 1337 }, + { "secret": "8100978d6a578cfc7aaae8985ef52ba6", "total": 1337 }, + { "secret": "af9f61512a7a1ae916fd57a560869902", "total": 1337 }, + { "secret": "a28212251026f0fc95a50e699e0bbf52", "total": 1337 }, + { "secret": "75354c5ccb5ca15e9ac5957ac0eee120", "total": 1337 }, + { "secret": "29798ff6a82107db17f5956ccef0f9c8", "total": 1337 }, + { "secret": "e34fbed1e4e62edb2cc208b63f6333ee", "total": 1337 }, + { "secret": "b0919edcbf3f2b7058f8c52c9e200817", "total": 1337 }, + { "secret": "20f9aa7c189af6e641a43669bebf1c63", "total": 1337 }, + { "secret": "27662c191b44387dc2f9d570fcf5b85c", "total": 1337 }, + { "secret": "85c5469b3ead42e50478508313b49418", "total": 1337 }, + { "secret": "0e24dc59f79432e187272e7acda01937", "total": 1337 }, + { "secret": "ead85fb72903a2afd28effc86cbb56d0", "total": 1337 }, + { "secret": "196f150fe4c07e24f6acbdf738a1b1fc", "total": 1337 }, + { "secret": "9c3864f9238f0cce2f74ff443b2a6440", "total": 1337 }, + { "secret": "3e4becc2d735395d8e0a4fb8a09c7fe3", "total": 1337 }, + { "secret": "ac1fc7bd9ff6a4d1aba624a63aed8c84", "total": 1337 }, + { "secret": "604dd62dfeba49338b31ff80d305cd34", "total": 1337 }, + { "secret": "7e6361f30035285c85e429c4284f8937", "total": 1337 }, + { "secret": "03a3bf159d76033999078d5074084c5f", "total": 1337 }, + { "secret": "eeda68363c9022a43b7c347705061adf", "total": 1337 }, + { "secret": "3abc72e252932a2ebcaa54928a684f89", "total": 1337 }, + { "secret": "66c12c9872ccbe669f570a45170f7b41", "total": 1337 }, + { "secret": "e5d68507f1c25bf0fe6670b44c02549d", "total": 1337 }, + { "secret": "c5ca2b81d9010ae7b01f6fca144fa3e1", "total": 1337 }, + { "secret": "e859e671a955086ed05f4590c07901db", "total": 1337 }, + { "secret": "2944ec35772a5cc6483f575525e758ec", "total": 1337 }, + { "secret": "62b0d8837cb13bb683b2c3c18c55c7b7", "total": 1337 }, + { "secret": "851e397ca5999e99d6f7c834361e39eb", "total": 1337 }, + { "secret": "a3b577f5d19e7316b83205be33340d16", "total": 1337 }, + { "secret": "26eb3922f3d8f54f63d222e0f741014f", "total": 1337 }, + { "secret": "76fa1f00d86a6ed4fa9eb924bdeb6ff8", "total": 1337 }, + { "secret": "8fa79a7002c57bb9af25ca0c865d1f38", "total": 1337 }, + { "secret": "622e39d99475594189b0ece366a8442a", "total": 1337 }, + { "secret": "ef39ff9463b6073de83cfca3d85def5a", "total": 1337 }, + { "secret": "6ed746afb0b77bc9b1066ac147a84001", "total": 1337 }, + { "secret": "9c3864f9238f0cce2f74ff443b2a6440", "total": 1337 }, + { "secret": "bd967e9e5344ec08f4e06bceb02aec0f", "total": 1337 }, + { "secret": "eaa66b1e6fb661de8fcd5576eeb53c40", "total": 1337 }, + { "secret": "06eca1b437c7904cc3ce6546c8110110", "total": 1337 }, + { "secret": "55a54008ad1ba589aa210d2629c1df41", "total": 1337 }, + { "secret": "8e9387cf50cd5b93fed7855dc47fc450", "total": 1337 }, + { "secret": "949bce404e88bdf08d96f360e6b4b1ef", "total": 1337 }, + { "secret": "fb23618e0203e0649386be6476d4236d", "total": 1337 }, + { "secret": "a83e33f5146fae45dcc9ca6c38760bb2", "total": 1337 }, + { "secret": "a68e54313b405840c028e070348c1ab6", "total": 1337 }, + { "secret": "a88b414d60df2832af16fbe4fcd2f349", "total": 1337 }, + { "secret": "e31368b1216ea637426a806064243978", "total": 1337 }, + { "secret": "40dc6a5c2bdd36b467681f85b0a51b4d", "total": 1337 }, + { "secret": "62a6bf80d87cf104557c64a773501fd4", "total": 1337 }, + { "secret": "fcf3d78a118d89ad6e9dcdab40a5a38b", "total": 1337 }, + { "secret": "76fa1f00d86a6ed4fa9eb924bdeb6ff8", "total": 1337 }, + { "secret": "f7a70562eab327c77641394d7cbe4cfc", "total": 1337 }, + { "secret": "48485b6f4f5373601aba8d1a6b526cf7", "total": 1337 }, + { "secret": "bd0ae5f0605974348db26f4049ee7a4f", "total": 1337 }, + { "secret": "622e39d99475594189b0ece366a8442a", "total": 1337 }, + { "secret": "781cc982ed0586214d32ffcb44aec0b5", "total": 1337 }, + { "secret": "c7be81a9a6761d5e90a83d48b9fd90a9", "total": 1337 }, + { "secret": "03785170b9cc4a831d60040ca8bb1c1b", "total": 1337 }, + { "secret": "e2ba905bf306f46faca223d3cb20e2cf", "total": 1337 }, + { "secret": "3828018642196cc4aff41d0adcafe43e", "total": 1337 }, + { "secret": "c2c2055d0aceb4ee059add9c8aadfec3", "total": 1337 }, + { "secret": "338606be8dc8372d0f6197a426a9bc60", "total": 1337 }, + { "secret": "43824742168520af98382e68f28f8564", "total": 1337 }, + { "secret": "88b0c0e58cf001f41945f680669e7d12", "total": 1337 }, + { "secret": "fc181a8fd8a9ab98d3d5a4cda53c3abe", "total": 1337 }, + { "secret": "147e8517f8323ad93e9e7a89bd771b04", "total": 1337 }, + { "secret": "9f865a2f087e8128fa538a2d28c4a71d", "total": 1337 }, + { "secret": "647235f6cd73cb3f6bec50adf8d6b958", "total": 1337 }, + { "secret": "1dcdc177cc6d94997b723efe213f9367", "total": 1337 }, + { "secret": "37dc50d0203ca1ba9548ad9a28769fd2", "total": 1337 }, + { "secret": "294c8d2fd78ee2818537ed31b3e846a7", "total": 1337 }, + { "secret": "75cbf55ad60ff5544b9d0dfad167ed13", "total": 1337 }, + { "secret": "f67eebe778016abf6bd4529bd0adeac3", "total": 1337 }, + { "secret": "c4188ce9fe6df1f224dbc320886d0604", "total": 1337 }, + { "secret": "7b470d952323e7717e459da8cf61bb64", "total": 1337 }, + { "secret": "35825261f21e5580b99fe57333f26927", "total": 1337 }, + { "secret": "fc181a8fd8a9ab98d3d5a4cda53c3abe", "total": 1337 }, + { "secret": "fe1096cd135688a1d586d820ca3f8d62", "total": 1337 }, + { "secret": "9de228839b2ccc8d08071bcada88ca6d", "total": 1337 }, + { "secret": "93c7a2768f9a4cb69b3b0516d533a6de", "total": 1337 }, + { "secret": "26eb3922f3d8f54f63d222e0f741014f", "total": 1337 }, + { "secret": "b9d723714d187d970a01ca5fcef8c439", "total": 1337 }, + { "secret": "769f641c508eb1cbd9d2ef1615ffc4f8", "total": 1337 }, + { "secret": "9af614971584f0b3d82e840f6b21b953", "total": 1337 }, + { "secret": "be7fc39360eac2ea9a4a1bbc7075dc6c", "total": 1337 }, + { "secret": "c89611a6856772647ce1d03ba1d45041", "total": 1337 }, + { "secret": "ecc0db791b06c64211e1118b818eca88", "total": 1337 }, + { "secret": "c1e5682fbdd39ed371b7e89b0e881cca", "total": 1337 }, + { "secret": "b73a8afb86d5a4c2523e28938696ed2d", "total": 1337 }, + { "secret": "a61abca182394af36649ef11aab8a176", "total": 1337 }, + { "secret": "b21ab08a29b85ef9ea7fd82df2b87e9f", "total": 1337 }, + { "secret": "f3040fcb274d572933acbea14d710c12", "total": 1337 }, + { "secret": "d264cac63c524837e711ace9ab7dab7b", "total": 1337 }, + { "secret": "ae6adb2a6b25c2fa8c86399bf3e37e93", "total": 1337 }, + { "secret": "92ca13cfa0db1c9db660ee0e7f4f3220", "total": 1337 }, + { "secret": "fb84c8e911eac15fbfe2dd7c93df3712", "total": 1337 }, + { "secret": "adbdf5b216b6a064a3ae6372fd55a7ac", "total": 1337 }, + { "secret": "f365c524c2e5846a0320d57536416de9", "total": 1337 }, + { "secret": "8c3434bfe3188948c5c3397e2ebb1d9f", "total": 1337 }, + { "secret": "9e51740711f1f539aefef82bb89a9822", "total": 1337 }, + { "secret": "589016850e76c84a45c41a474c99fa82", "total": 1337 }, + { "secret": "630f826e1097fa6e520acd8907a8183c", "total": 1337 }, + { "secret": "21c57fcccd4274e94b8fd5279d5dc856", "total": 1337 }, + { "secret": "57db60e93fb52657521f8f99cbc7398f", "total": 1337 }, + { "secret": "5eedbebd290f47de4c8879ef2f25190b", "total": 1337 }, + { "secret": "c5ca2b81d9010ae7b01f6fca144fa3e1", "total": 1337 }, + { "secret": "d800f7de040d5f65d3bb720b675dbd99", "total": 1337 }, + { "secret": "7aaacd820965ef78133b6b3a36f00189", "total": 1337 }, + { "secret": "11870cb56df12527e588f2ef967232e8", "total": 1337 }, + { "secret": "296229166e55508f0965e9f0d8c6c9d8", "total": 1337 }, + { "secret": "116669088ae3c85f1da0b8c783935f70", "total": 1337 }, + { "secret": "7f91e08b8bfd640780cb4fc9c43a89a8", "total": 1337 }, + { "secret": "fa6db1e8eac249d05446193687acd55e", "total": 1337 }, + { "secret": "3fbf315e2c3187f24171a17c7d077898", "total": 1337 }, + { "secret": "e601821dfa76d3865a7b904008b95d7e", "total": 1337 }, + { "secret": "5f0343d324dc954601e25148557bb060", "total": 1337 }, + { "secret": "2ca267fef3aa1e70e699504155e42410", "total": 1337 }, + { "secret": "85f1d937567c86d20e82870a6620da31", "total": 1337 }, + { "secret": "77c5f5752730770277fe94030b74f37f", "total": 1337 }, + { "secret": "d0ef81942a79596af5990216e3d17b4e", "total": 1337 }, + { "secret": "657dda2e892d6cd2cb93072ca7ecb6cf", "total": 1337 }, + { "secret": "0a681488e46ca97cdfe730f3120c09e1", "total": 1337 }, + { "secret": "9f5529996a50afcea29b8ba07468dfae", "total": 1337 }, + { "secret": "e67ea5a065780d5509aa0adc095137b5", "total": 1337 }, + { "secret": "a77c4f948d93d1f5161391136cac908b", "total": 1337 }, + { "secret": "01e9802fd906341a2b769125c562d95c", "total": 1337 }, + { "secret": "c1e5682fbdd39ed371b7e89b0e881cca", "total": 1337 }, + { "secret": "0ce0d1cd996c91ed22dead00174471c2", "total": 1337 }, + { "secret": "8e9387cf50cd5b93fed7855dc47fc450", "total": 1337 }, + { "secret": "23ab995e980e397f5c95835f1ac979c5", "total": 1337 }, + { "secret": "d96d21f320274aa46e8fe047a2518e25", "total": 1337 }, + { "secret": "a698349cdff5be9d53c59282d499ed06", "total": 1337 }, + { "secret": "9b0c9e02ce58f812e9d63ec6f3cfb297", "total": 1337 }, + { "secret": "7e62d784d20c1942575ebdb9ec1db8c0", "total": 1337 }, + { "secret": "632686e3b7ad446aabcaac367ce7b0f6", "total": 1337 }, + { "secret": "2da95ea36a34e4e701946820db6fa3fe", "total": 1337 }, + { "secret": "98d9e1fe1de8ec000e7d67f864fd33b0", "total": 1337 }, + { "secret": "8262d1513f98f1413b8da50d32698f58", "total": 1337 }, + { "secret": "75cbf55ad60ff5544b9d0dfad167ed13", "total": 1337 }, + { "secret": "29fd9b7a08824c947140321606c52eb1", "total": 1337 }, + { "secret": "b4026e0710d59598561ade2959eda496", "total": 1337 }, + { "secret": "ead1f1bb221e5cab4d065182c48b734c", "total": 1337 }, + { "secret": "ef39ff9463b6073de83cfca3d85def5a", "total": 1337 }, + { "secret": "d6b3d0cb28777219cad62da2591c31ae", "total": 1337 }, + { "secret": "d6ba17ecfd6d576a0ed2a5f244169283", "total": 1337 }, + { "secret": "a61abca182394af36649ef11aab8a176", "total": 1337 }, + { "secret": "b0919edcbf3f2b7058f8c52c9e200817", "total": 1337 }, + { "secret": "515f7ae8216670facb85f171f2bd716a", "total": 1337 }, + { "secret": "ead85fb72903a2afd28effc86cbb56d0", "total": 1337 }, + { "secret": "2f0ea707bf0cf054c3ed7e8aa69b6805", "total": 1337 }, + { "secret": "5e97164e8d556378810ee7e9474ded90", "total": 1337 }, + { "secret": "6f0816663d98dcc38b8052667ed71337", "total": 1337 }, + { "secret": "2ef769c85254d9aba16dc5d62c5684d4", "total": 1337 }, + { "secret": "2fd9d0f622bab4400a22124f4a09a39d", "total": 1337 }, + { "secret": "d0ef81942a79596af5990216e3d17b4e", "total": 1337 }, + { "secret": "30013e17db3e185d029bbfa6535ebe37", "total": 1337 }, + { "secret": "632686e3b7ad446aabcaac367ce7b0f6", "total": 1337 }, + { "secret": "d4e21b0d48f671e403616487a71691fc", "total": 1337 }, + { "secret": "82ca471eea853009173af486ed173c07", "total": 1337 }, + { "secret": "a38c3ccc9a819a84880bbed75951ac39", "total": 1337 }, + { "secret": "bf1e8ed89fefd8e0129a792bcd2c8ce6", "total": 1337 }, + { "secret": "c2e6a09ba4b1085f9dae1d787517279b", "total": 1337 }, + { "secret": "effd38f806f0538e00c75e6f8533b970", "total": 1337 }, + { "secret": "f315b8422a745bbb27e0b8976b5f06e7", "total": 1337 }, + { "secret": "d18c3b7e55335427865e11e3b7341427", "total": 1337 }, + { "secret": "87201405e44122f1de7ae94cf2d96f8b", "total": 1337 }, + { "secret": "d4cdb8e9b7fb58a7baaba746deee3d03", "total": 1337 }, + { "secret": "58a8bc17edd11cd37c7956823c5e6c3d", "total": 1337 }, + { "secret": "ff78c6ea9eb2fd7ad1b4e6799c0ea374", "total": 1337 }, + { "secret": "bbaf54db884d6e7ea9252c44ecb45f54", "total": 1337 }, + { "secret": "c304446287ac82bc2763588a36e34515", "total": 1337 }, + { "secret": "aec2c5bd835ed360e73a94110296107a", "total": 1337 }, + { "secret": "50db8c0878037e4f2e594188ba0cb033", "total": 1337 }, + { "secret": "70c24dfd17decbe5c913aaa4e3c169d4", "total": 1337 }, + { "secret": "01e9802fd906341a2b769125c562d95c", "total": 1337 }, + { "secret": "3def3dd56bfbfcc8926f000c9dd42eb0", "total": 1337 }, + { "secret": "11870cb56df12527e588f2ef967232e8", "total": 1337 }, + { "secret": "5c8381ee06a41467d02ea3772b502f26", "total": 1337 }, + { "secret": "1261f3a2294ea5419d7f6265aa4e65f5", "total": 1337 }, + { "secret": "589016850e76c84a45c41a474c99fa82", "total": 1337 }, + { "secret": "b9daf720c04f7f9ff186f7e2815326ed", "total": 1337 }, + { "secret": "23ab995e980e397f5c95835f1ac979c5", "total": 1337 }, + { "secret": "4da8647d38d01f981f1700e4ac1416de", "total": 1337 }, + { "secret": "36d9d8df7a0a21c339bf74e2a30d68bd", "total": 1337 }, + { "secret": "1af31cc69182179c5da3a05c7bc0f62d", "total": 1337 }, + { "secret": "98da24f23875679db8c576b7d9e0abd1", "total": 1337 }, + { "secret": "116669088ae3c85f1da0b8c783935f70", "total": 1337 }, + { "secret": "6a7a30288ece2c2442f52982c01305b9", "total": 1337 }, + { "secret": "632686e3b7ad446aabcaac367ce7b0f6", "total": 1337 }, + { "secret": "c38e41cf880623cec59807a858865ee9", "total": 1337 }, + { "secret": "1a29fd1e3c0f55c3ffac7dc7019d92d7", "total": 1337 }, + { "secret": "ce3bcb813d6541a80af3a6f85e9b8d17", "total": 1337 }, + { "secret": "85c66f54331d1fe689e9a1c761a53423", "total": 1337 }, + { "secret": "e34fbed1e4e62edb2cc208b63f6333ee", "total": 1337 }, + { "secret": "616d6b0257a76ad1407f24cb6c45f7a3", "total": 1337 }, + { "secret": "9c7ebcd454763e223d2e5455aaff7c28", "total": 1337 }, + { "secret": "9ed4a12cf365a4e7f4569fee07c1e276", "total": 1337 }, + { "secret": "0324de4b2e3c4a0d60e9d76bb597d704", "total": 1337 }, + { "secret": "4e02906fc02e0502b4371c1ab1c794e0", "total": 1337 }, + { "secret": "9169714479bcb89af9639113a907ff5e", "total": 1337 }, + { "secret": "6721862949a51064cd99aaa58e320747", "total": 1337 }, + { "secret": "c52d145a27960c202e74f6d4d3bcf803", "total": 1337 }, + { "secret": "b8d8c02f901a44212b06f5b668408927", "total": 1337 }, + { "secret": "23807b2eeb6719d64829a1b2b88682de", "total": 1337 }, + { "secret": "ee955a30a583247de7da2af0d1bc4f28", "total": 1337 }, + { "secret": "bf953887c553c1553e0ffd9ccfc8ed24", "total": 1337 }, + { "secret": "05183a2384267752c3f73b3255c97b9a", "total": 1337 }, + { "secret": "df102a5f51aff008ee649aa7b1a27164", "total": 1337 }, + { "secret": "95945a6e35eb13f3a27a2356fb973622", "total": 1337 }, + { "secret": "1f902054b63902375fa9641222634cbb", "total": 1337 }, + { "secret": "b10d07ceae1b035f21265a24b34d6dc8", "total": 1337 }, + { "secret": "e4fec03eb29162ac5cefb239b302dae6", "total": 1337 }, + { "secret": "a5bb83b82b98f41b359f20dbf9db6e44", "total": 1337 }, + { "secret": "adbdf5b216b6a064a3ae6372fd55a7ac", "total": 1337 }, + { "secret": "4330a38509818e575001de4c288aa334", "total": 1337 }, + { "secret": "79fb72f2f7a0f2c48845061f5b680a3d", "total": 1337 }, + { "secret": "22a7fa4477d23a1eb30b9f976d94a53f", "total": 1337 }, + { "secret": "8374f96cc135bee7c02d129fba5d6dfb", "total": 1337 }, + { "secret": "98d9e1fe1de8ec000e7d67f864fd33b0", "total": 1337 }, + { "secret": "cd14ecc6dadc7a30954ef9c76303a524", "total": 1337 }, + { "secret": "2aea596b3ad18baa0797f4337096df2c", "total": 1337 }, + { "secret": "48ef1297dfc352549cbf7dd1d7a4fba5", "total": 1337 }, + { "secret": "6a7a30288ece2c2442f52982c01305b9", "total": 1337 }, + { "secret": "adae3f54b662e662a7c6a98c0b0735ea", "total": 1337 }, + { "secret": "f44d7fab86866af3bc1ed8af69d7a87d", "total": 1337 }, + { "secret": "042f7301c555f92b96f34a22acc07ecf", "total": 1337 }, + { "secret": "8262d1513f98f1413b8da50d32698f58", "total": 1337 }, + { "secret": "d5e420bcfff7894475e33d569e4a8b64", "total": 1337 }, + { "secret": "657dda2e892d6cd2cb93072ca7ecb6cf", "total": 1337 }, + { "secret": "ef39ff9463b6073de83cfca3d85def5a", "total": 1337 }, + { "secret": "29fd9b7a08824c947140321606c52eb1", "total": 1337 }, + { "secret": "59d882d5037704ccaf383fd7b5bf5a96", "total": 1337 }, + { "secret": "270fd45059d4d65fd0f74d556802aaab", "total": 1337 }, + { "secret": "8d33744cc2cd21c705425780aca41b2f", "total": 1337 }, + { "secret": "0304ddcc84f713ffee5b48aaf85b64d9", "total": 1337 }, + { "secret": "9af614971584f0b3d82e840f6b21b953", "total": 1337 }, + { "secret": "632686e3b7ad446aabcaac367ce7b0f6", "total": 1337 }, + { "secret": "b0d829c5412aac684be1c25b928ccf62", "total": 1337 }, + { "secret": "8a7ea3516f353de45b95b4c3317f3c69", "total": 1337 }, + { "secret": "196f150fe4c07e24f6acbdf738a1b1fc", "total": 1337 }, + { "secret": "dd75ec426c36356afd6a9987a175824b", "total": 1337 }, + { "secret": "70f24df82b635129b05e909f1252a2fb", "total": 1337 }, + { "secret": "81a730cedb78f5c048bffb550d6e48eb", "total": 1337 }, + { "secret": "f22150943d1239300ec80ef87fff8caf", "total": 1337 }, + { "secret": "6668c77143a8ddb191753f8655e194eb", "total": 1337 }, + { "secret": "b55df7fe0d0ec6e9d3c3d74a06f4faf1", "total": 1337 }, + { "secret": "ac1fc7bd9ff6a4d1aba624a63aed8c84", "total": 1337 }, + { "secret": "57db60e93fb52657521f8f99cbc7398f", "total": 1337 }, + { "secret": "67b2885beaf6dad6d518626ecd3ef46d", "total": 1337 }, + { "secret": "ba178db21c4ae67dbd3a3f2638870b0c", "total": 1337 }, + { "secret": "52011b773ca5047d3c6c60a7ed16712e", "total": 1337 }, + { "secret": "251c1fa8a1e95434a64dce0d4826443e", "total": 1337 }, + { "secret": "eacce13aea02f7677cbc0417b556ed13", "total": 1337 }, + { "secret": "d19f2fe67eb6e9eebec53bf3942d9b5f", "total": 1337 }, + { "secret": "cb54cdda45424ea636fcfc4a594a1bd3", "total": 1337 }, + { "secret": "6c4db4899c29f6e674dfe0431f3758f5", "total": 1337 }, + { "secret": "196f150fe4c07e24f6acbdf738a1b1fc", "total": 1337 }, + { "secret": "338ce4b20f7acfe2f4edbf1b1c25db16", "total": 1337 }, + { "secret": "249ba6277758050695e8f5909bacd6d3", "total": 1337 }, + { "secret": "30a771fb83c2f5000a74d41689f19c76", "total": 1337 }, + { "secret": "1f67c3ce915a6e8479a2985a0fb73e45", "total": 1337 }, + { "secret": "9a4f48c371ae1d214d719be64ae9fbb0", "total": 1337 }, + { "secret": "986eda35eaf991175c41b82657c10121", "total": 1337 }, + { "secret": "f7c57f06a1d3ce117749fc98e2111668", "total": 1337 }, + { "secret": "3cd89ecd798c284aa6215a9b0f3ea6f9", "total": 1337 }, + { "secret": "ca0edb48a7e8ba82ad98b6338fdbd572", "total": 1337 }, + { "secret": "e1cd204920edf0669c260d1645a8d85a", "total": 1337 }, + { "secret": "00fdf875daea8f6b1f0e6303418aa59e", "total": 1337 }, + { "secret": "8dc1d9a2159ca89dbd7e5c185e6aa132", "total": 1337 }, + { "secret": "ef9022d3f773f4420c35553e450e44cf", "total": 1337 }, + { "secret": "066858618b356a50d2a1a85bbc032985", "total": 1337 }, + { "secret": "fd14c46d0ce7311f5c4db6f69bd2c5b2", "total": 1337 }, + { "secret": "9a4f48c371ae1d214d719be64ae9fbb0", "total": 1337 }, + { "secret": "1774360a6bb6ceeff99b0a2e7864b2d1", "total": 1337 }, + { "secret": "c7be81a9a6761d5e90a83d48b9fd90a9", "total": 1337 }, + { "secret": "f2af162e05c5cd75812382d4476524dc", "total": 1337 }, + { "secret": "e80e9d52b4190bbc26b776c8d02f7ace", "total": 1337 }, + { "secret": "1f67c3ce915a6e8479a2985a0fb73e45", "total": 1337 }, + { "secret": "4fb8ead6535ffe257649fb1d60a962d0", "total": 1337 }, + { "secret": "ea1f3b05d7a371b6839efc10df7f37eb", "total": 1337 }, + { "secret": "fb84c8e911eac15fbfe2dd7c93df3712", "total": 1337 }, + { "secret": "1515b2650a207bf789ab96d2d9f3b90a", "total": 1337 }, + { "secret": "5c1f9bbe155e84e335c8a1a26ac46462", "total": 1337 }, + { "secret": "1f67c3ce915a6e8479a2985a0fb73e45", "total": 1337 }, + { "secret": "fc181a8fd8a9ab98d3d5a4cda53c3abe", "total": 1337 }, + { "secret": "f3040fcb274d572933acbea14d710c12", "total": 1337 }, + { "secret": "6b2c74005056c043fb8b5c44f3ab9b4b", "total": 1337 }, + { "secret": "a28212251026f0fc95a50e699e0bbf52", "total": 1337 }, + { "secret": "fcd0e945e738c436e98e256284ff9a96", "total": 1337 }, + { "secret": "a61abca182394af36649ef11aab8a176", "total": 1337 }, + { "secret": "b21ab08a29b85ef9ea7fd82df2b87e9f", "total": 1337 }, + { "secret": "0e59d3565e3279ce557deb04ec47b7c6", "total": 1337 }, + { "secret": "ccf2775035946698557437f45feed1b7", "total": 1337 }, + { "secret": "685318a98bc338a99404265c2c736d41", "total": 1337 }, + { "secret": "af9f61512a7a1ae916fd57a560869902", "total": 1337 }, + { "secret": "dec204019b7d3e7e7230886178df07ba", "total": 1337 }, + { "secret": "ae6adb2a6b25c2fa8c86399bf3e37e93", "total": 1337 }, + { "secret": "82afe0c3369284d076b9bc77714077f8", "total": 1337 }, + { "secret": "46e2535e90798349df26a25dcfec1353", "total": 1337 }, + { "secret": "4cd1162bb61e111ce1b069bc9c15c8c2", "total": 1337 }, + { "secret": "8288b41ce03754137c0ebcb84e6334ef", "total": 1337 }, + { "secret": "81a730cedb78f5c048bffb550d6e48eb", "total": 1337 }, + { "secret": "dce8b63ac8d56a678f9b8eb78650625a", "total": 1337 }, + { "secret": "190c4369c6f5646493007bebec046893", "total": 1337 }, + { "secret": "5289df737df57326fcdd22597afb1fac", "total": 1337 }, + { "secret": "66f65c34d08755b622dd560debb70387", "total": 1337 }, + { "secret": "6d12a24959ae47f8e15ee8a89e07d0c2", "total": 1337 }, + { "secret": "fcad97fa4e69c491096cb90df3b03a50", "total": 1337 }, + { "secret": "81a730cedb78f5c048bffb550d6e48eb", "total": 1337 }, + { "secret": "0a8b08903c74adde482c1c134a9d0104", "total": 1337 }, + { "secret": "d8988aa121630246d62d017cf2abbc28", "total": 1337 }, + { "secret": "85c66f54331d1fe689e9a1c761a53423", "total": 1337 }, + { "secret": "81fab34eb4238c9fca1e48fc8842f58d", "total": 1337 }, + { "secret": "d4d9e2fb5e2c48d671fbc59cbfc689cd", "total": 1337 }, + { "secret": "c4188ce9fe6df1f224dbc320886d0604", "total": 1337 }, + { "secret": "7e0e538d6acf90b2c2b8ebd9d0835f2c", "total": 1337 }, + { "secret": "38ee752481d126e8dd0b8e849836f75a", "total": 1337 }, + { "secret": "677e3013dbcd68e35b1bd9a12bdf5070", "total": 1337 }, + { "secret": "783c06a93b916cb517ab91c4028725cd", "total": 1337 }, + { "secret": "a1ecacc2893c4130fa14d3dfae130c8f", "total": 1337 }, + { "secret": "4fb8ead6535ffe257649fb1d60a962d0", "total": 1337 }, + { "secret": "ade5deaebc373edad4cb97085c798ccc", "total": 1337 }, + { "secret": "657dda2e892d6cd2cb93072ca7ecb6cf", "total": 1337 }, + { "secret": "fd930df70b98acbb3cf646e2e8ef1185", "total": 1337 }, + { "secret": "ecc0db791b06c64211e1118b818eca88", "total": 1337 }, + { "secret": "25daad3d9e60b45043a70c4ab7d3b1c6", "total": 1337 }, + { "secret": "6972ad17d5c923ae1df0cdc021b7ecc4", "total": 1337 }, + { "secret": "bf1e8ed89fefd8e0129a792bcd2c8ce6", "total": 1337 }, + { "secret": "58a8bc17edd11cd37c7956823c5e6c3d", "total": 1337 }, + { "secret": "59d882d5037704ccaf383fd7b5bf5a96", "total": 1337 }, + { "secret": "0c898eb9595bc7f363bcbd9a6b7385e4", "total": 1337 }, + { "secret": "f4bf5ae64f65892b6ea56fe2b843200b", "total": 1337 }, + { "secret": "b422a71b2967939a4e3ce02a0fd283cc", "total": 1337 }, + { "secret": "e1cd204920edf0669c260d1645a8d85a", "total": 1337 }, + { "secret": "8030b3dcdd08a28c2aaca1d6ea25053d", "total": 1337 }, + { "secret": "2c4eb866d1a0c54f4e0a04e2063e1f19", "total": 1337 }, + { "secret": "80a37416f944a7ae7f0ad7f5d6080a64", "total": 1337 }, + { "secret": "f203981fa4c1e3fece3b17dd7dc73a7b", "total": 1337 }, + { "secret": "c2115a6dcf40aca159a21b8edb7c951c", "total": 1337 }, + { "secret": "769f641c508eb1cbd9d2ef1615ffc4f8", "total": 1337 }, + { "secret": "6f158cd6f06586a0fb536de8ba9b6a53", "total": 1337 }, + { "secret": "d771bc3c1b5d5d5111328423600c60bb", "total": 1337 }, + { "secret": "fd930df70b98acbb3cf646e2e8ef1185", "total": 1337 }, + { "secret": "9f5529996a50afcea29b8ba07468dfae", "total": 1337 }, + { "secret": "ee955a30a583247de7da2af0d1bc4f28", "total": 1337 }, + { "secret": "b160dd4d48fe3a8d2a20bd530c0b69d6", "total": 1337 }, + { "secret": "910ad7be44e19257c9a4b90c4098e07e", "total": 1337 }, + { "secret": "616d6b0257a76ad1407f24cb6c45f7a3", "total": 1337 }, + { "secret": "07ddcef12df2e10829a43919a4cb18d6", "total": 1337 }, + { "secret": "291740682538150487812ff655fa32e5", "total": 1337 }, + { "secret": "b73a8afb86d5a4c2523e28938696ed2d", "total": 1337 }, + { "secret": "194d8b2566a6cd04836d78cffab3d4fa", "total": 1337 }, + { "secret": "f44d7fab86866af3bc1ed8af69d7a87d", "total": 1337 }, + { "secret": "848b404bf853b66f9d200898e4705349", "total": 1337 }, + { "secret": "8faa25098b7e252bc2e03373a480039e", "total": 1337 }, + { "secret": "ba178db21c4ae67dbd3a3f2638870b0c", "total": 1337 }, + { "secret": "72b493a02c614157ce8b6e7b53ae33d3", "total": 1337 }, + { "secret": "d4e58633f8516a29b47d7cfd4dd8beef", "total": 1337 }, + { "secret": "d90553e33ad99a71dbc860452fd6d5a3", "total": 1337 }, + { "secret": "685bb8fe18d1981d9246676d553e496e", "total": 1337 }, + { "secret": "3795246e713626fd07c8e381d6c08aa2", "total": 1337 }, + { "secret": "80e6eef03522bb5137c886c69108b16d", "total": 1337 }, + { "secret": "08d12ed160c5b7b24eee378f66b72aaa", "total": 1337 }, + { "secret": "5b02107ca2d0906fbe4d9f612b8160da", "total": 1337 }, + { "secret": "f581adc68126acbbccc8a1582f8b8c57", "total": 1337 }, + { "secret": "77ae9b529ef7eb48a85eedc20853ce3c", "total": 1337 }, + { "secret": "35825261f21e5580b99fe57333f26927", "total": 1337 }, + { "secret": "e4a4bbf19aeee78ea8b8b4ff4c2ff3c1", "total": 1337 }, + { "secret": "6878ebc5de0156b3b403dcbcaa4f82b3", "total": 1337 }, + { "secret": "f43d2360c3ad6c083b0b67a3ad4b053d", "total": 1337 }, + { "secret": "62a6bf80d87cf104557c64a773501fd4", "total": 1337 }, + { "secret": "5eedbebd290f47de4c8879ef2f25190b", "total": 1337 }, + { "secret": "8030b3dcdd08a28c2aaca1d6ea25053d", "total": 1337 }, + { "secret": "07d4f780e3528db8c539ee5c21fddeae", "total": 1337 }, + { "secret": "ac2bfee68b9182158d1c5bab47effd65", "total": 1337 }, + { "secret": "c5ca2b81d9010ae7b01f6fca144fa3e1", "total": 1337 }, + { "secret": "0a681488e46ca97cdfe730f3120c09e1", "total": 1337 }, + { "secret": "a5cc3713c192d098a8ba0810961edab6", "total": 1337 }, + { "secret": "d6ba17ecfd6d576a0ed2a5f244169283", "total": 1337 }, + { "secret": "a832edf87f4121e9c3b829eb0c194cce", "total": 1337 }, + { "secret": "e9610053a422ecf2f33a75323b36989f", "total": 1337 }, + { "secret": "598f4fe64aefab8f00bcbea4c9239abf", "total": 1337 }, + { "secret": "48485b6f4f5373601aba8d1a6b526cf7", "total": 1337 }, + { "secret": "0d8d60dfc63a6acfb419dda16f936c33", "total": 1337 }, + { "secret": "73553dc668de24c7e4b2620cc9123279", "total": 1337 }, + { "secret": "bce5ed98d14ecc5fa6e692fbefccf7f2", "total": 1337 }, + { "secret": "38ee752481d126e8dd0b8e849836f75a", "total": 1337 }, + { "secret": "b523813764833b875022c851f5bae654", "total": 1337 }, + { "secret": "0d8d60dfc63a6acfb419dda16f936c33", "total": 1337 }, + { "secret": "19b893b938ace1defe7d090e510f0618", "total": 1337 }, + { "secret": "29fd9b7a08824c947140321606c52eb1", "total": 1337 }, + { "secret": "a95789966b1b9fd89e86a849cbcc4e76", "total": 1337 }, + { "secret": "b55df7fe0d0ec6e9d3c3d74a06f4faf1", "total": 1337 }, + { "secret": "30013e17db3e185d029bbfa6535ebe37", "total": 1337 }, + { "secret": "5815b1c7623e2b04c68a9fb48eb811e8", "total": 1337 }, + { "secret": "0a4df26984f992ce64a32123be5715ef", "total": 1337 }, + { "secret": "33d50e88578395c1a8b0ef37189f3539", "total": 1337 }, + { "secret": "c1264b165b0e029d9d49ae2e2af66821", "total": 1337 }, + { "secret": "aec2c5bd835ed360e73a94110296107a", "total": 1337 }, + { "secret": "809c2f4a058f0d6d9524b29e698c0ad8", "total": 1337 }, + { "secret": "9a5a0e1d8e290d413ec17a8db1412c65", "total": 1337 }, + { "secret": "e4a4bbf19aeee78ea8b8b4ff4c2ff3c1", "total": 1337 }, + { "secret": "196f150fe4c07e24f6acbdf738a1b1fc", "total": 1337 }, + { "secret": "07ddcef12df2e10829a43919a4cb18d6", "total": 1337 }, + { "secret": "61fa7a30105863bf30291196961371e4", "total": 1337 }, + { "secret": "311954a44a5fa2e1fabb60f608a949ff", "total": 1337 }, + { "secret": "21c57fcccd4274e94b8fd5279d5dc856", "total": 1337 }, + { "secret": "8241014d6bca1344490587afb42a9fff", "total": 1337 }, + { "secret": "af9f61512a7a1ae916fd57a560869902", "total": 1337 }, + { "secret": "ff78c6ea9eb2fd7ad1b4e6799c0ea374", "total": 1337 }, + { "secret": "f43d2360c3ad6c083b0b67a3ad4b053d", "total": 1337 }, + { "secret": "cc6ae8b90748398ed6cf9b1eaa18efea", "total": 1337 }, + { "secret": "1bcaef6edad729498f2deb05c216b39a", "total": 1337 }, + { "secret": "3e4becc2d735395d8e0a4fb8a09c7fe3", "total": 1337 }, + { "secret": "604dd62dfeba49338b31ff80d305cd34", "total": 1337 }, + { "secret": "03e8c00dea408b2002f87f55eb0154d3", "total": 1337 }, + { "secret": "7e6361f30035285c85e429c4284f8937", "total": 1337 }, + { "secret": "c765b294837825690b7ad7fc60eccfcf", "total": 1337 }, + { "secret": "0b76148f385d3b46b8005e202f0d42a0", "total": 1337 }, + { "secret": "73d0a7b3fab51beeee8ba428b9cd1d47", "total": 1337 }, + { "secret": "677e3013dbcd68e35b1bd9a12bdf5070", "total": 1337 }, + { "secret": "be4d7c1d0394b341c3c1c3d91ae528d7", "total": 1337 }, + { "secret": "20b1eea1131c6ddc7bcd79ceb80abaf7", "total": 1337 }, + { "secret": "8d33744cc2cd21c705425780aca41b2f", "total": 1337 }, + { "secret": "37dc50d0203ca1ba9548ad9a28769fd2", "total": 1337 }, + { "secret": "d6ba17ecfd6d576a0ed2a5f244169283", "total": 1337 }, + { "secret": "2e63d75cdbd02e920cf2f8ea3859da09", "total": 1337 }, + { "secret": "ccf2775035946698557437f45feed1b7", "total": 1337 }, + { "secret": "6ed746afb0b77bc9b1066ac147a84001", "total": 1337 }, + { "secret": "934a322df7eb8457c6a22c106ad5ba68", "total": 1337 }, + { "secret": "6878ebc5de0156b3b403dcbcaa4f82b3", "total": 1337 }, + { "secret": "ce3bcb813d6541a80af3a6f85e9b8d17", "total": 1337 }, + { "secret": "eacce13aea02f7677cbc0417b556ed13", "total": 1337 }, + { "secret": "7c7ef0c7ffccbb26917bc2da90350eee", "total": 1337 }, + { "secret": "63c174cd54273a8dde5c55f179afff47", "total": 1337 }, + { "secret": "48485b6f4f5373601aba8d1a6b526cf7", "total": 1337 }, + { "secret": "8df122dffc3195150329b20a93c673d9", "total": 1337 }, + { "secret": "d6b3d0cb28777219cad62da2591c31ae", "total": 1337 }, + { "secret": "3ceeb60b36bcc2114d07065f22300576", "total": 1337 }, + { "secret": "a88b414d60df2832af16fbe4fcd2f349", "total": 1337 }, + { "secret": "80a6dd924ccce6983203b7f0afbfb38e", "total": 1337 }, + { "secret": "0a681488e46ca97cdfe730f3120c09e1", "total": 1337 }, + { "secret": "30013e17db3e185d029bbfa6535ebe37", "total": 1337 }, + { "secret": "2a205ce1d7499c789ba9a0363038e195", "total": 1337 }, + { "secret": "1261f3a2294ea5419d7f6265aa4e65f5", "total": 1337 }, + { "secret": "307a4b760d05f493863dbdd8f387fd99", "total": 1337 } +] \ No newline at end of file From 9eebe6ab1f61d103322ee15d337e9bc1831e9d10 Mon Sep 17 00:00:00 2001 From: Peter Van Drunen Date: Tue, 11 Sep 2018 21:25:55 -0400 Subject: [PATCH 3/7] Passes update tests update operation now passes a simple test. --- src/index.js | 5 +++-- src/spec/index_spec.js | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index 243123b..8edf722 100644 --- a/src/index.js +++ b/src/index.js @@ -24,13 +24,14 @@ module.exports = { return collection.insertMany(records) }, update: async () => { - // TODO: Find a way to use mongodb's updateMany instead of sending one transaction per record + // make sure we have some index so we can select the correct record to update if (typeof config.indexName === 'undefined') { return Promise.reject(Error('Operation type was update, but no index was provided.')); } + // TODO: Find a way to use mongodb's updateMany instead of sending one transaction per record // update each record in tandem. - return Promise.all( records.map((doc) => collection.updateOne({[config.indexName]: r[config.indexName]}, { $set: r })) ); + return Promise.all( records.map((doc) => collection.updateMany({[config.indexName]: doc[config.indexName]}, { $set: doc })) ); }, delete: async () => { /* delete items matching a filter */ }, invalid: () => { return Promise.reject(Error(`Invalid operation type: ${config.operationType}`)) } diff --git a/src/spec/index_spec.js b/src/spec/index_spec.js index 3a08d0d..2ede0fa 100644 --- a/src/spec/index_spec.js +++ b/src/spec/index_spec.js @@ -104,7 +104,8 @@ const updateAllDocuments = (config, done) => { {}, config, { - operationType: 'update' + operationType: 'update', + indexName: 'secret' } ); fs.createReadStream(UPDATE_DATA_FILE_LOCATION) @@ -118,11 +119,11 @@ const updateAllDocuments = (config, done) => { }); }; -const ensureAllDocumentsUpdated = async (done) => { +const ensureAllDocumentsUpdated = async (config, done) => { const db = await connect(); - const data = await db.collection(config.collection).find({}); + const data = await db.collection(config.collection).find({}).toArray(); + data.forEach((d) => { expect(d.total).toEqual(UPDATE_DATA_FILE_VALUE) }); await db.close(); - data.forEach((d) => expect(d.total).toEqual(UPDATE_DATA_FILE_VALUE)); done(); }; From fc4db3cae844b36df98600d21b48c320036dee2a Mon Sep 17 00:00:00 2001 From: Peter Van Drunen Date: Tue, 11 Sep 2018 21:32:53 -0400 Subject: [PATCH 4/7] More testing Added a few more basic tests for the update operation --- src/spec/index_spec.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/spec/index_spec.js b/src/spec/index_spec.js index 2ede0fa..3992911 100644 --- a/src/spec/index_spec.js +++ b/src/spec/index_spec.js @@ -55,9 +55,23 @@ describe('.streamToMongoDB', () => { }); describe('updates with given options', () => { - describe('with batchSize same as the number of documents to be streamed', () => { + describe('with default batchSize', () => { it('it updates all totals to the same value', (done) => { - config.batchSize = expectedNumberOfRecords; + config.batchSize = 1; + runUpdateStream(config, done); + }); + }); + + describe('with batchSize less than number of documents to be streamed', () => { + it('it streams the expected number of documents to MongoDB', (done) => { + config.batchSize = expectedNumberOfRecords - 3; + runUpdateStream(config, done); + }); + }); + + describe('with batchSize more than the number of documents to be streamed', () => { + it('it streams the expected number of documents to MongoDB', (done) => { + config.batchSize = expectedNumberOfRecords * 100; runUpdateStream(config, done); }); }); From 5b9f0524026efb1e6f3df1c71e9dd2c4168f7f9c Mon Sep 17 00:00:00 2001 From: Peter Van Drunen Date: Tue, 11 Sep 2018 21:36:37 -0400 Subject: [PATCH 5/7] Tests added one more basic test to the spec --- src/spec/index_spec.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/spec/index_spec.js b/src/spec/index_spec.js index 3992911..fdd2c33 100644 --- a/src/spec/index_spec.js +++ b/src/spec/index_spec.js @@ -26,11 +26,17 @@ describe('.streamToMongoDB', () => { }); describe('with no given options', () => { - it('it uses the default config to stream the expected number of documents to MongoDB', async (done) => { + it('uses the default config to insert the expected number of documents to MongoDB', async (done) => { runInsertStream(config, done); }); }); + describe('with no given options for an update', () => { + it('uses the default config to update the records in the db', async (done) => { + runUpdateStream(config, done); + }) + }); + describe('inserts with given options', () => { describe('with batchSize same as the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { @@ -55,9 +61,9 @@ describe('.streamToMongoDB', () => { }); describe('updates with given options', () => { - describe('with default batchSize', () => { - it('it updates all totals to the same value', (done) => { - config.batchSize = 1; + describe('with batchSize same as the number of documents to be streamed', () => { + it('it streams the expected number of documents to MongoDB', (done) => { + config.batchSize = expectedNumberOfRecords; runUpdateStream(config, done); }); }); From 5a263fd31020b50121cdded3995ed91f95f711d2 Mon Sep 17 00:00:00 2001 From: Peter Van Drunen Date: Tue, 11 Sep 2018 21:41:52 -0400 Subject: [PATCH 6/7] Added tests and operations for delete Tests are passing. --- src/index.js | 13 ++++++-- src/spec/index_spec.js | 69 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 8edf722..85d4c9a 100644 --- a/src/index.js +++ b/src/index.js @@ -29,11 +29,20 @@ module.exports = { return Promise.reject(Error('Operation type was update, but no index was provided.')); } - // TODO: Find a way to use mongodb's updateMany instead of sending one transaction per record + // TODO: Find a better way to use mongodb's updateMany instead of sending one transaction per record // update each record in tandem. return Promise.all( records.map((doc) => collection.updateMany({[config.indexName]: doc[config.indexName]}, { $set: doc })) ); }, - delete: async () => { /* delete items matching a filter */ }, + delete: async () => { + // make sure we have some index so we can select the correct record to update + if (typeof config.indexName === 'undefined') { + return Promise.reject(Error('Operation type was delete, but no index was provided.')); + } + + // TODO: Find a better way to use mongodb's deleteMany instead of sending one transaction per record + // update each record in tandem. + return Promise.all( records.map((doc) => collection.deleteMany({[config.indexName]: doc[config.indexName]}, { $set: doc })) ); + }, invalid: () => { return Promise.reject(Error(`Invalid operation type: ${config.operationType}`)) } }; diff --git a/src/spec/index_spec.js b/src/spec/index_spec.js index fdd2c33..05bc09e 100644 --- a/src/spec/index_spec.js +++ b/src/spec/index_spec.js @@ -25,18 +25,21 @@ describe('.streamToMongoDB', () => { done(); }); + // insert basic describe('with no given options', () => { it('uses the default config to insert the expected number of documents to MongoDB', async (done) => { runInsertStream(config, done); }); }); + // update basic describe('with no given options for an update', () => { it('uses the default config to update the records in the db', async (done) => { runUpdateStream(config, done); }) }); + // inserts with options describe('inserts with given options', () => { describe('with batchSize same as the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { @@ -60,6 +63,7 @@ describe('.streamToMongoDB', () => { }); }); + // updates with options describe('updates with given options', () => { describe('with batchSize same as the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { @@ -82,6 +86,30 @@ describe('.streamToMongoDB', () => { }); }); }); + + // deletes with options + describe('deletes with given options', () => { + describe('with batchSize same as the number of documents to be streamed', () => { + it('it streams the expected number of documents to MongoDB', (done) => { + config.batchSize = expectedNumberOfRecords; + runDeleteStream(config, done); + }); + }); + + describe('with batchSize less than number of documents to be streamed', () => { + it('it streams the expected number of documents to MongoDB', (done) => { + config.batchSize = expectedNumberOfRecords - 3; + runDeleteStream(config, done); + }); + }); + + describe('with batchSize more than the number of documents to be streamed', () => { + it('it streams the expected number of documents to MongoDB', (done) => { + config.batchSize = expectedNumberOfRecords * 100; + runDeleteStream(config, done); + }); + }); + }); }); const connect = () => MongoDB.MongoClient.connect(config.dbURL); @@ -147,6 +175,47 @@ const ensureAllDocumentsUpdated = async (config, done) => { done(); }; +const runDeleteStream = (config, done) => { + fs.createReadStream(INSERT_DATA_FILE_LOCATION) + .pipe(JSONStream.parse('*')) + .pipe(StreamToMongoDB.streamToMongoDB(config)) + .on('error', (err) => { + done.fail(err); + }) + .on('close', () => { + deleteAllDocuments(config, done); + }); +} + +const deleteAllDocuments = (config, done) => { + // update every document to have the same total + const options = Object.assign( + {}, + config, + { + operationType: 'delete', + indexName: 'secret' + } + ); + fs.createReadStream(UPDATE_DATA_FILE_LOCATION) + .pipe(JSONStream.parse('*')) + .pipe(StreamToMongoDB.streamToMongoDB(options)) + .on('error', (err) => { + done.fail(err); + }) + .on('close', () => { + ensureAllDocumentsDeleted(config, done); + }); +} + +const ensureAllDocumentsDeleted = async (config, done) => { + const db = await connect(); + const count = await db.collection(config.collection).count(); + expect(count).toEqual(0); + await db.close(); + done(); +}; + const clearDB = async () => { const dbConnection = await connect(); await dbConnection.dropDatabase(); From d002f8e55c36a5349fa8188a96cb43711555b9fe Mon Sep 17 00:00:00 2001 From: Peter Van Drunen Date: Tue, 11 Sep 2018 21:50:10 -0400 Subject: [PATCH 7/7] eslint on prior commits Cleaned up the code somewhat. Renamed some of the variables in index_spec.js to avoid shadowing. --- src/index.js | 16 ++++++------ src/spec/index_spec.js | 58 +++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/index.js b/src/index.js index 85d4c9a..8307352 100644 --- a/src/index.js +++ b/src/index.js @@ -20,8 +20,8 @@ module.exports = { // Supported operations const operations = { - insert: async () => { - return collection.insertMany(records) + insert: async () => { + return collection.insertMany(records); }, update: async () => { // make sure we have some index so we can select the correct record to update @@ -29,21 +29,21 @@ module.exports = { return Promise.reject(Error('Operation type was update, but no index was provided.')); } - // TODO: Find a better way to use mongodb's updateMany instead of sending one transaction per record // update each record in tandem. - return Promise.all( records.map((doc) => collection.updateMany({[config.indexName]: doc[config.indexName]}, { $set: doc })) ); - }, + return Promise.all(records.map(doc => + collection.updateMany({ [config.indexName]: doc[config.indexName] }, { $set: doc }))); + }, delete: async () => { // make sure we have some index so we can select the correct record to update if (typeof config.indexName === 'undefined') { return Promise.reject(Error('Operation type was delete, but no index was provided.')); } - // TODO: Find a better way to use mongodb's deleteMany instead of sending one transaction per record // update each record in tandem. - return Promise.all( records.map((doc) => collection.deleteMany({[config.indexName]: doc[config.indexName]}, { $set: doc })) ); + return Promise.all(records.map(doc => + collection.deleteMany({ [config.indexName]: doc[config.indexName] }, { $set: doc }))); }, - invalid: () => { return Promise.reject(Error(`Invalid operation type: ${config.operationType}`)) } + invalid: () => { return Promise.reject(Error(`Invalid operation type: ${config.operationType}`)); } }; // Utility for writing to the db with the correct operation diff --git a/src/spec/index_spec.js b/src/spec/index_spec.js index 05bc09e..05ce315 100644 --- a/src/spec/index_spec.js +++ b/src/spec/index_spec.js @@ -1,4 +1,4 @@ -/* global beforeAll, beforeEach, afterAll, expect, it, describe */ +/* global beforeEach, afterAll, expect, it, describe */ import MongoDB from 'mongodb'; import fs from 'fs'; import path from 'path'; @@ -10,7 +10,7 @@ const UPDATE_DATA_FILE_LOCATION = path.resolve('src/spec/support/updateData.json const UPDATE_DATA_FILE_VALUE = 1337; const testDB = 'streamToMongoDB'; -const config = { dbURL: `mongodb://localhost:27017/${testDB}`, collection: 'test' }; +const testConfig = { dbURL: `mongodb://localhost:27017/${testDB}`, collection: 'test' }; const expectedNumberOfRecords = require('./support/insertData.json').length; @@ -28,37 +28,37 @@ describe('.streamToMongoDB', () => { // insert basic describe('with no given options', () => { it('uses the default config to insert the expected number of documents to MongoDB', async (done) => { - runInsertStream(config, done); + runInsertStream(testConfig, done); }); }); // update basic describe('with no given options for an update', () => { it('uses the default config to update the records in the db', async (done) => { - runUpdateStream(config, done); - }) + runUpdateStream(testConfig, done); + }); }); // inserts with options describe('inserts with given options', () => { describe('with batchSize same as the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords; - runInsertStream(config, done); + testConfig.batchSize = expectedNumberOfRecords; + runInsertStream(testConfig, done); }); }); describe('with batchSize less than number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords - 3; - runInsertStream(config, done); + testConfig.batchSize = expectedNumberOfRecords - 3; + runInsertStream(testConfig, done); }); }); describe('with batchSize more than the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords * 100; - runInsertStream(config, done); + testConfig.batchSize = expectedNumberOfRecords * 100; + runInsertStream(testConfig, done); }); }); }); @@ -67,22 +67,22 @@ describe('.streamToMongoDB', () => { describe('updates with given options', () => { describe('with batchSize same as the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords; - runUpdateStream(config, done); + testConfig.batchSize = expectedNumberOfRecords; + runUpdateStream(testConfig, done); }); }); describe('with batchSize less than number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords - 3; - runUpdateStream(config, done); + testConfig.batchSize = expectedNumberOfRecords - 3; + runUpdateStream(testConfig, done); }); }); describe('with batchSize more than the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords * 100; - runUpdateStream(config, done); + testConfig.batchSize = expectedNumberOfRecords * 100; + runUpdateStream(testConfig, done); }); }); }); @@ -91,28 +91,28 @@ describe('.streamToMongoDB', () => { describe('deletes with given options', () => { describe('with batchSize same as the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords; - runDeleteStream(config, done); + testConfig.batchSize = expectedNumberOfRecords; + runDeleteStream(testConfig, done); }); }); describe('with batchSize less than number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords - 3; - runDeleteStream(config, done); + testConfig.batchSize = expectedNumberOfRecords - 3; + runDeleteStream(testConfig, done); }); }); describe('with batchSize more than the number of documents to be streamed', () => { it('it streams the expected number of documents to MongoDB', (done) => { - config.batchSize = expectedNumberOfRecords * 100; - runDeleteStream(config, done); + testConfig.batchSize = expectedNumberOfRecords * 100; + runDeleteStream(testConfig, done); }); }); }); }); -const connect = () => MongoDB.MongoClient.connect(config.dbURL); +const connect = () => MongoDB.MongoClient.connect(testConfig.dbURL); const runInsertStream = (config, done) => { fs.createReadStream(INSERT_DATA_FILE_LOCATION) @@ -122,11 +122,11 @@ const runInsertStream = (config, done) => { done.fail(err); }) .on('close', () => { - ensureAllDocumentsInserted(done); + ensureAllDocumentsInserted(config, done); }); }; -const ensureAllDocumentsInserted = async (done) => { +const ensureAllDocumentsInserted = async (config, done) => { const db = await connect(); const count = await db.collection(config.collection).count(); await db.close(); @@ -170,7 +170,7 @@ const updateAllDocuments = (config, done) => { const ensureAllDocumentsUpdated = async (config, done) => { const db = await connect(); const data = await db.collection(config.collection).find({}).toArray(); - data.forEach((d) => { expect(d.total).toEqual(UPDATE_DATA_FILE_VALUE) }); + data.forEach((d) => { expect(d.total).toEqual(UPDATE_DATA_FILE_VALUE); }); await db.close(); done(); }; @@ -185,7 +185,7 @@ const runDeleteStream = (config, done) => { .on('close', () => { deleteAllDocuments(config, done); }); -} +}; const deleteAllDocuments = (config, done) => { // update every document to have the same total @@ -206,7 +206,7 @@ const deleteAllDocuments = (config, done) => { .on('close', () => { ensureAllDocumentsDeleted(config, done); }); -} +}; const ensureAllDocumentsDeleted = async (config, done) => { const db = await connect();