{"action":"created","issue":{"url":"https://api.github.com/repos/nicolaiarocci/eve/issues/600","labels_url":"https://api.github.com/repos/nicolaiarocci/eve/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/nicolaiarocci/eve/issues/600/comments","events_url":"https://api.github.com/repos/nicolaiarocci/eve/issues/600/events","html_url":"https://github.com/nicolaiarocci/eve/issues/600","id":68303043,"number":600,"title":"`unique` schema won't work with a string value looks like a `ObjectId`","user":{"login":"whitetrefoil","id":573851,"avatar_url":"https://avatars.githubusercontent.com/u/573851?v=3","gravatar_id":"","url":"https://api.github.com/users/whitetrefoil","html_url":"https://github.com/whitetrefoil","followers_url":"https://api.github.com/users/whitetrefoil/followers","following_url":"https://api.github.com/users/whitetrefoil/following{/other_user}","gists_url":"https://api.github.com/users/whitetrefoil/gists{/gist_id}","starred_url":"https://api.github.com/users/whitetrefoil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitetrefoil/subscriptions","organizations_url":"https://api.github.com/users/whitetrefoil/orgs","repos_url":"https://api.github.com/users/whitetrefoil/repos","events_url":"https://api.github.com/users/whitetrefoil/events{/privacy}","received_events_url":"https://api.github.com/users/whitetrefoil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-14T08:31:05Z","updated_at":"2015-04-14T08:57:28Z","closed_at":null,"body":"version 0.5.3\r\n\r\nI've got a resource which has a field `user` while it's actually a foreign key to the `_id` of `Users` resource.  And I've set that field to be **unique**.\r\n\r\nWhen tried to **POST** `{\"user\":\"552c9d8123cebf1bfcf70c3c\"}` multiple times, it just passed every time and created new records in DB every time.\r\n\r\nThen I tried to modify that field to a simple `string` and used the same request but it still passed.\r\n\r\nI did a quick step tracing and soon found that the query to be used to find the existing record is `{\"user\":\"552c9d8123cebf1bfcf70c3c\"}` initially, but it was modified to ``{\"user\":ObjectId(\"552c9d8123cebf1bfcf70c3c\")}`` after `self._mongotize(v, resource)` at eve/io/mongo/mongo.py line 664.\r\n\r\nI guess there may be something wrong which cause a **\"`string` looks like `ObjectId`\"** to be mistakenly converted to an `ObjectId`."},"comment":{"url":"https://api.github.com/repos/nicolaiarocci/eve/issues/comments/92704993","html_url":"https://github.com/nicolaiarocci/eve/issues/600#issuecomment-92704993","issue_url":"https://api.github.com/repos/nicolaiarocci/eve/issues/600","id":92704993,"user":{"login":"otibsa","id":5006696,"avatar_url":"https://avatars.githubusercontent.com/u/5006696?v=3","gravatar_id":"","url":"https://api.github.com/users/otibsa","html_url":"https://github.com/otibsa","followers_url":"https://api.github.com/users/otibsa/followers","following_url":"https://api.github.com/users/otibsa/following{/other_user}","gists_url":"https://api.github.com/users/otibsa/gists{/gist_id}","starred_url":"https://api.github.com/users/otibsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otibsa/subscriptions","organizations_url":"https://api.github.com/users/otibsa/orgs","repos_url":"https://api.github.com/users/otibsa/repos","events_url":"https://api.github.com/users/otibsa/events{/privacy}","received_events_url":"https://api.github.com/users/otibsa/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T08:57:28Z","updated_at":"2015-04-14T08:57:28Z","body":"Correct me if I'm wrong, but this seems to be related to #599.\r\nHave you tried setting `query_objectid_as_string = True`?"}}