{"action":"created","issue":{"url":"https://api.github.com/repos/florianholzapfel/express-restify-mongoose/issues/313","repository_url":"https://api.github.com/repos/florianholzapfel/express-restify-mongoose","labels_url":"https://api.github.com/repos/florianholzapfel/express-restify-mongoose/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/florianholzapfel/express-restify-mongoose/issues/313/comments","events_url":"https://api.github.com/repos/florianholzapfel/express-restify-mongoose/issues/313/events","html_url":"https://github.com/florianholzapfel/express-restify-mongoose/issues/313","id":185216561,"number":313,"title":"Is there a way to query records that contain a portion of the _id","user":{"login":"Quixomatic","id":2008821,"avatar_url":"https://avatars.githubusercontent.com/u/2008821?v=3","gravatar_id":"","url":"https://api.github.com/users/Quixomatic","html_url":"https://github.com/Quixomatic","followers_url":"https://api.github.com/users/Quixomatic/followers","following_url":"https://api.github.com/users/Quixomatic/following{/other_user}","gists_url":"https://api.github.com/users/Quixomatic/gists{/gist_id}","starred_url":"https://api.github.com/users/Quixomatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quixomatic/subscriptions","organizations_url":"https://api.github.com/users/Quixomatic/orgs","repos_url":"https://api.github.com/users/Quixomatic/repos","events_url":"https://api.github.com/users/Quixomatic/events{/privacy}","received_events_url":"https://api.github.com/users/Quixomatic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-25T19:51:44Z","updated_at":"2016-10-26T00:46:44Z","closed_at":null,"body":"So if the id of a record is `5760680f87d4a5d8074e1597`\r\n\r\nCan we do something like `?query={\"_id\":\">=57\"}` ?\r\nCurrently this throws an error:\r\n```\r\n{\r\n\"message\": \"Cast to ObjectId failed for value \\\"57\\\" at path \\\"_id\\\"\",\r\n\"name\": \"CastError\",\r\n\"kind\": \"ObjectId\",\r\n\"value\": \"57\",\r\n\"path\": \"_id\"\r\n}\r\n```\r\n\r\nI know that string fields seem to work fine like when field `table_name` is `sp_quiz`\r\n\r\nYou could do something like `?query={\"table_name\":\">=sp_\"}`"},"comment":{"url":"https://api.github.com/repos/florianholzapfel/express-restify-mongoose/issues/comments/256219887","html_url":"https://github.com/florianholzapfel/express-restify-mongoose/issues/313#issuecomment-256219887","issue_url":"https://api.github.com/repos/florianholzapfel/express-restify-mongoose/issues/313","id":256219887,"user":{"login":"Zertz","id":2636763,"avatar_url":"https://avatars.githubusercontent.com/u/2636763?v=3","gravatar_id":"","url":"https://api.github.com/users/Zertz","html_url":"https://github.com/Zertz","followers_url":"https://api.github.com/users/Zertz/followers","following_url":"https://api.github.com/users/Zertz/following{/other_user}","gists_url":"https://api.github.com/users/Zertz/gists{/gist_id}","starred_url":"https://api.github.com/users/Zertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zertz/subscriptions","organizations_url":"https://api.github.com/users/Zertz/orgs","repos_url":"https://api.github.com/users/Zertz/repos","events_url":"https://api.github.com/users/Zertz/events{/privacy}","received_events_url":"https://api.github.com/users/Zertz/received_events","type":"User","site_admin":false},"created_at":"2016-10-26T00:46:44Z","updated_at":"2016-10-26T00:46:44Z","body":"ObjectId's are not a string and cannot be queried like that. However, you can sort by _id and combine that with skip and limit to get documents in the order they were inserted. This isn't entirely true in the case of a sharded cluster and perhaps other setups, but it should work in most cases."}}
{"actor":{"display_login":"Zertz"}}