{"action":"created","issue":{"url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/11","labels_url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/11/comments","events_url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/11/events","html_url":"https://github.com/codecapers/mongodb-rest/issues/11","id":90265025,"number":11,"title":"Querying a nested id.","user":{"login":"atanasbozhkov","id":1144752,"avatar_url":"https://avatars.githubusercontent.com/u/1144752?v=3","gravatar_id":"","url":"https://api.github.com/users/atanasbozhkov","html_url":"https://github.com/atanasbozhkov","followers_url":"https://api.github.com/users/atanasbozhkov/followers","following_url":"https://api.github.com/users/atanasbozhkov/following{/other_user}","gists_url":"https://api.github.com/users/atanasbozhkov/gists{/gist_id}","starred_url":"https://api.github.com/users/atanasbozhkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atanasbozhkov/subscriptions","organizations_url":"https://api.github.com/users/atanasbozhkov/orgs","repos_url":"https://api.github.com/users/atanasbozhkov/repos","events_url":"https://api.github.com/users/atanasbozhkov/events{/privacy}","received_events_url":"https://api.github.com/users/atanasbozhkov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-23T02:05:25Z","updated_at":"2015-06-24T23:47:39Z","closed_at":null,"body":"I am using the latest version of mongodb-rest with mongodb 3.0.3. I am trying to get a record by filtering on a nested id. \r\n\r\nI have the following document in my Passport collection:\r\n\r\n    \"_id\": {\r\n        \"$oid\": \"553a25f1bc2e8b53c7000002\"\r\n    }, \r\n    \"answer\": \"none\", \r\n    \"password\": \"somePassword\", \r\n    \"provider\": \"local\",  \r\n    \"user\": {\r\n        \"$oid\": \"553a25f1bc2e8b53c7000001\"\r\n    }\r\n    }\r\n\r\nWhen I query all the results through mongodb-rest the structure changes to: \r\n\r\n     \"_id\": \"553a25f1bc2e8b53c7000002\", \r\n     \"answer\": \"none\", \r\n    \"password\": \"somePassword\", \r\n    \"provider\": \"local\",  \r\n    \"user\": \"553a25f1bc2e8b53c7000001\"\r\n    }\r\n\r\nwhich I find simpler and cleaner - but inconsistent. \r\n\r\nI can filter the collection by the object _id by doing something like\r\n\r\n    $ http http://localhost:8080/test/Passport/553a25f1bc2e8b53c7000002\r\n\r\nwhich returns the correct result. \r\n\r\nI am trying to get the record by filtering on the user.id field. \r\nSo when I tried to get it - I try the following request (as shown in the previous issue):\r\n\r\n     $ http http://localhost:8080/test/Passport?query=\"{'user._id':'553a25f1bc2e8b53c7000001'}\"\r\n\r\nBut it returns an empty set? I've also tried the following:\r\n\r\n     $ http http://localhost:8080/test/Passport?query=\"{'user':{'_id':'553a25f1bc2e8b53c7000001'}}\"\r\n\r\nbut it still returns an empty set. \r\nAny idea what the correct way of doing this is?"},"comment":{"url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/comments/115047316","html_url":"https://github.com/codecapers/mongodb-rest/issues/11#issuecomment-115047316","issue_url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/11","id":115047316,"user":{"login":"atanasbozhkov","id":1144752,"avatar_url":"https://avatars.githubusercontent.com/u/1144752?v=3","gravatar_id":"","url":"https://api.github.com/users/atanasbozhkov","html_url":"https://github.com/atanasbozhkov","followers_url":"https://api.github.com/users/atanasbozhkov/followers","following_url":"https://api.github.com/users/atanasbozhkov/following{/other_user}","gists_url":"https://api.github.com/users/atanasbozhkov/gists{/gist_id}","starred_url":"https://api.github.com/users/atanasbozhkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atanasbozhkov/subscriptions","organizations_url":"https://api.github.com/users/atanasbozhkov/orgs","repos_url":"https://api.github.com/users/atanasbozhkov/repos","events_url":"https://api.github.com/users/atanasbozhkov/events{/privacy}","received_events_url":"https://api.github.com/users/atanasbozhkov/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T23:47:39Z","updated_at":"2015-06-24T23:47:39Z","body":"I have implemented a fix in #12 "}}