The best module ever.
$ npm install array-comparator --save
Comparator for use with the chrysalis framework: [https://github.com/APPrise-Mobile/chrysalis] This is the module used to determine what documents need to be created, based on a comparative array of documents the endpoint database already contains, and an array of comparative keys to compare. These keys are usually unique identifiers for each document, the framework will then check to see if the value of the compareKey exists on any of the documents from the compare array. If it doesn't exists, then the document is marked for creation.
Support for update and deletion coming soon.
var arrayComparator = ;var chrysalis = ;var options =comparativeKeys: 'integrationId'comparativeArray: mongoData;var comparator = ;var chrysis = ;chrysis;
MIT © APPrise-Mobile