{"action":"closed","issue":{"url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/475","labels_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/475/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/475/comments","events_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/475/events","html_url":"https://github.com/aldeed/meteor-simple-schema/issues/475","id":112099607,"number":475,"title":"Cannot convert an object to an array","user":{"login":"HosseinAgha","id":12998499,"avatar_url":"https://avatars.githubusercontent.com/u/12998499?v=3","gravatar_id":"","url":"https://api.github.com/users/HosseinAgha","html_url":"https://github.com/HosseinAgha","followers_url":"https://api.github.com/users/HosseinAgha/followers","following_url":"https://api.github.com/users/HosseinAgha/following{/other_user}","gists_url":"https://api.github.com/users/HosseinAgha/gists{/gist_id}","starred_url":"https://api.github.com/users/HosseinAgha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HosseinAgha/subscriptions","organizations_url":"https://api.github.com/users/HosseinAgha/orgs","repos_url":"https://api.github.com/users/HosseinAgha/repos","events_url":"https://api.github.com/users/HosseinAgha/events{/privacy}","received_events_url":"https://api.github.com/users/HosseinAgha/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-19T08:42:30Z","updated_at":"2015-10-19T08:55:01Z","closed_at":"2015-10-19T08:55:01Z","body":"First `Description` field had an Object Type in Schema. now I have changed its type to Array. with the code bellow:\r\n```coffescript\r\n  cons = Contributors.find().fetch()\r\n  check = Object::toString\r\n  for i in cons\r\n    if i.Description? and check.call(i.Description) != \"[object Array]\"\r\n      tempDesc = _.clone(i.Description)\r\n      Contributors.update _id: i._id,\r\n        $unset:\r\n          Description: \"\"\r\n      console.log \"This is old object:\"\r\n      console.log tempDesc\r\n      Contributors.update _id: i._id,\r\n        $addToSet:\r\n          Description: tempDesc\r\n      console.log \"This is new Object:\"\r\n      console.log tempDesc\r\n``` \r\nIt seems update function completely deletes the given object and it will store an array with an empty object `[{}]` in the DB.\r\nI tried to clone the Description before update but no luck."}}