{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails-mongo/issues/152","labels_url":"https://api.github.com/repos/balderdashy/sails-mongo/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails-mongo/issues/152/comments","events_url":"https://api.github.com/repos/balderdashy/sails-mongo/issues/152/events","html_url":"https://github.com/balderdashy/sails-mongo/issues/152","id":34170854,"number":152,"title":"unique validation broken","user":{"login":"4ndr3w","id":913400,"avatar_url":"https://avatars.githubusercontent.com/u/913400?v=3","gravatar_id":"","url":"https://api.github.com/users/4ndr3w","html_url":"https://github.com/4ndr3w","followers_url":"https://api.github.com/users/4ndr3w/followers","following_url":"https://api.github.com/users/4ndr3w/following{/other_user}","gists_url":"https://api.github.com/users/4ndr3w/gists{/gist_id}","starred_url":"https://api.github.com/users/4ndr3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4ndr3w/subscriptions","organizations_url":"https://api.github.com/users/4ndr3w/orgs","repos_url":"https://api.github.com/users/4ndr3w/repos","events_url":"https://api.github.com/users/4ndr3w/events{/privacy}","received_events_url":"https://api.github.com/users/4ndr3w/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/balderdashy/sails-mongo/labels/needs%20fix","name":"needs fix","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/balderdashy/sails-mongo/milestones/3","labels_url":"https://api.github.com/repos/balderdashy/sails-mongo/milestones/3/labels","id":633249,"number":3,"title":"Work In Progress","description":"","creator":{"login":"particlebanana","id":370260,"avatar_url":"https://avatars.githubusercontent.com/u/370260?v=3","gravatar_id":"","url":"https://api.github.com/users/particlebanana","html_url":"https://github.com/particlebanana","followers_url":"https://api.github.com/users/particlebanana/followers","following_url":"https://api.github.com/users/particlebanana/following{/other_user}","gists_url":"https://api.github.com/users/particlebanana/gists{/gist_id}","starred_url":"https://api.github.com/users/particlebanana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/particlebanana/subscriptions","organizations_url":"https://api.github.com/users/particlebanana/orgs","repos_url":"https://api.github.com/users/particlebanana/repos","events_url":"https://api.github.com/users/particlebanana/events{/privacy}","received_events_url":"https://api.github.com/users/particlebanana/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":3,"state":"open","created_at":"2014-04-17T18:01:57Z","updated_at":"2014-08-21T23:05:58Z","due_on":null,"closed_at":null},"comments":31,"created_at":"2014-05-23T12:37:30Z","updated_at":"2015-02-06T23:41:02Z","closed_at":"2014-08-21T23:05:58Z","body":"On a fresh sails project, I tested with the following model:\r\n\r\n```\r\nmodule.exports = {\r\n  attributes: {\r\n    name: {\r\n      type:\"string\",\r\n      required: true,\r\n      unique: true\r\n    }\r\n  }\r\n};\r\n```\r\n\r\nThen in sails console:\r\n\r\n```\r\nsails> Test.create({name:\"Test\"}).exec(console.log);\r\n{ name: 'Test',\r\n  createdAt: Fri May 23 2014 08:27:05 GMT-0400 (EDT),\r\n  updatedAt: Fri May 23 2014 08:27:05 GMT-0400 (EDT),\r\n  id: '537f3e99d1486c321c770a88' }\r\n\r\nsails> Test.create({name:\"Test\"}).exec(console.log);\r\n{ name: 'Test',\r\n  createdAt: Fri May 23 2014 08:27:07 GMT-0400 (EDT),\r\n  updatedAt: Fri May 23 2014 08:27:07 GMT-0400 (EDT),\r\n  id: '537f3e9bd1486c321c770a89' }\r\n```\r\n\r\nWith the disk adapter, the second create returns an error as expected, so it seems to be an issue with the mongo adapter.\r\n\r\nSails: 0.10.0-rc7\r\nMongo Adapter 0.10.0-rc5\r\n"},"comment":{"url":"https://api.github.com/repos/balderdashy/sails-mongo/issues/comments/73333739","html_url":"https://github.com/balderdashy/sails-mongo/issues/152#issuecomment-73333739","issue_url":"https://api.github.com/repos/balderdashy/sails-mongo/issues/152","id":73333739,"user":{"login":"Cadroctet","id":7645160,"avatar_url":"https://avatars.githubusercontent.com/u/7645160?v=3","gravatar_id":"","url":"https://api.github.com/users/Cadroctet","html_url":"https://github.com/Cadroctet","followers_url":"https://api.github.com/users/Cadroctet/followers","following_url":"https://api.github.com/users/Cadroctet/following{/other_user}","gists_url":"https://api.github.com/users/Cadroctet/gists{/gist_id}","starred_url":"https://api.github.com/users/Cadroctet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cadroctet/subscriptions","organizations_url":"https://api.github.com/users/Cadroctet/orgs","repos_url":"https://api.github.com/users/Cadroctet/repos","events_url":"https://api.github.com/users/Cadroctet/events{/privacy}","received_events_url":"https://api.github.com/users/Cadroctet/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T23:41:02Z","updated_at":"2015-02-06T23:41:02Z","body":"Any news about this issue fix ?"}}