Skip to content

Latest commit

 

History

History
14 lines (8 loc) · 1.21 KB

.readme.md

File metadata and controls

14 lines (8 loc) · 1.21 KB

Node.js template This is a Node.js project.

Problem There are 2 json files under the data folder. 1.collectionList.json - Represents the list of collections 2.counts.json - Represents counts of documents on collections in db1 & db2 for different stores

Write a Node js code to first read the collectionList and counts Json files and do some processing to get 2 different kinds of output as descrided below

Result 1:

Need the collections with maximum difference under each store as below based on the collection list provided in collectionList.json.

Note: It should avoid the collection for computation if it is not in the collectionList json meaning if the collection with max value is not present in the collectionList it should avoid that value and consider the next maximum value.

[{"storeId" : "35378", "collection": "storeprofiles", "difference": 80 }, {"storeId" : "26673", "collection": "itemimages", "difference": 120 }, {"storeId" : "26676", "collection": "storeprofiles", "difference": 100 }, {"storeId" : "26678", "collection": "itemimages", "difference": 140 }, {"storeId" : "26679", "collection": "storeconfiguration", "difference": 290 }, {"storeId" : "26690", "collection": "storeconfiguration", "difference": 280 } ]