{"action":"opened","issue":{"url":"https://api.github.com/repos/aldeed/meteor-collection2/issues/193","labels_url":"https://api.github.com/repos/aldeed/meteor-collection2/issues/193/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-collection2/issues/193/comments","events_url":"https://api.github.com/repos/aldeed/meteor-collection2/issues/193/events","html_url":"https://github.com/aldeed/meteor-collection2/issues/193","id":63117918,"number":193,"title":"autoValue check on any field","user":{"login":"rustanacexd","id":4982729,"avatar_url":"https://avatars.githubusercontent.com/u/4982729?v=3","gravatar_id":"","url":"https://api.github.com/users/rustanacexd","html_url":"https://github.com/rustanacexd","followers_url":"https://api.github.com/users/rustanacexd/followers","following_url":"https://api.github.com/users/rustanacexd/following{/other_user}","gists_url":"https://api.github.com/users/rustanacexd/gists{/gist_id}","starred_url":"https://api.github.com/users/rustanacexd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustanacexd/subscriptions","organizations_url":"https://api.github.com/users/rustanacexd/orgs","repos_url":"https://api.github.com/users/rustanacexd/repos","events_url":"https://api.github.com/users/rustanacexd/events{/privacy}","received_events_url":"https://api.github.com/users/rustanacexd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-19T23:43:14Z","updated_at":"2015-03-19T23:43:14Z","closed_at":null,"body":"Hello I saw the example on docs on how to check for a certain field if has value and then do something, however I am wondering how can I  check if either of the fields is update. \r\n\r\n\r\nexample:  I want to do updateHistory field whenever \r\n\r\n```\r\nSchemas.DomainStats = new SimpleSchema({\r\n    pageRank: {\r\n        type: Number,\r\n        label: \"Page Rank\",\r\n        optional: true\r\n    },\r\n\r\n    domainAuthority: {\r\n        type: Number,\r\n        label: \"Domain Authority\",\r\n        optional: true\r\n    },\r\n\r\n    pageAuthority: {\r\n        type: Number,\r\n        label: \"Page Authority\",\r\n        optional: true\r\n    },\r\n\r\n   updatesHistory: {\r\n        type: [Object],\r\n        optional: true,\r\n        autoValue: function () {\r\n            var content = this.field(\"pageRank\");\r\n            if (content.isSet) {\r\n                if (this.isInsert) {\r\n                    return [{\r\n                        date: new Date,\r\n                        content: content.value\r\n                    }];\r\n                } else {\r\n                    return {\r\n                        $push: {\r\n                            date: new Date,\r\n                            content: content.value\r\n                        }\r\n                    };\r\n                }\r\n            } else {\r\n                this.unset();\r\n            }\r\n        }\r\n    },\r\n    'updatesHistory.$.date': {\r\n        type: Date,\r\n        optional: true\r\n    },\r\n    'updatesHistory.$.content': {\r\n        type: String,\r\n        optional: true\r\n    }\r\n});\r\n```\r\nI'm thinking like this but I could not make it work. it doesn't update the updatesHistory field\r\n```\r\nupdatesHistory: {\r\n        type: [Object],\r\n        optional: true,\r\n        autoValue: function () {\r\n            var pageRank = this.field(\"pageRank\");\r\n            var domainAuthority = this.field(\"domainAuthority\");\r\n            var pageAuthority = this.field(\"pageAuthority\");\r\n\r\n            var self = this;\r\n\r\n            var output = _.each([pageRank, pageAuthority, domainAuthority],\r\n                function (content) {\r\n                    if (content.isSet) {\r\n                        if (self.isInsert) {\r\n                            return [{\r\n                                date: new Date,\r\n                                content: content.value\r\n                            }];\r\n                        } else {\r\n                            return {\r\n                                $push: {\r\n                                    date: new Date,\r\n                                    content: content.value\r\n                                }\r\n                            };\r\n                        }\r\n                    } else {\r\n                       self.unset();\r\n                    }\r\n\r\n                });\r\n\r\n           return output;\r\n\r\n        },\r\n        autoform: {\r\n            omit: true\r\n        }\r\n    },\r\n    'updatesHistory.$.date': {\r\n        type: Date,\r\n        optional: true\r\n    },\r\n    'updatesHistory.$.content': {\r\n        type: String,\r\n        optional: true\r\n    }\r\n```"}}