here module.exports = function(changeEvent) { // event handler code goes here console.log("Changes in realm at:", changeEvent.path); var realm = changeEvent.realm; for (var className in changeEvent.changes) { var changes = changeEvent.changes[className]; var objects = realm.objects(className); ... } console.log(""); };
i < changes.insertions.length; i++) { pos = changes.insertions[i]; var inserted = objects[pos] ... } for (i = 0; i < changes.modifications.length; i++) { pos = changes.modifications[i]; var modified = objects[pos] ... } for (i = 0; i < changes.deletions.length; i++) { pos = changes.deletions[i]; var deleted = objects[pos] ... }