{"action":"opened","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/3715","labels_url":"https://api.github.com/repos/emberjs/data/issues/3715/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/3715/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/3715/events","html_url":"https://github.com/emberjs/data/issues/3715","id":103752967,"number":3715,"title":"Retrieve item from store by attribute?","user":{"login":"jackweinbender","id":1544859,"avatar_url":"https://avatars.githubusercontent.com/u/1544859?v=3","gravatar_id":"","url":"https://api.github.com/users/jackweinbender","html_url":"https://github.com/jackweinbender","followers_url":"https://api.github.com/users/jackweinbender/followers","following_url":"https://api.github.com/users/jackweinbender/following{/other_user}","gists_url":"https://api.github.com/users/jackweinbender/gists{/gist_id}","starred_url":"https://api.github.com/users/jackweinbender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackweinbender/subscriptions","organizations_url":"https://api.github.com/users/jackweinbender/orgs","repos_url":"https://api.github.com/users/jackweinbender/repos","events_url":"https://api.github.com/users/jackweinbender/events{/privacy}","received_events_url":"https://api.github.com/users/jackweinbender/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-28T16:40:36Z","updated_at":"2015-08-28T16:40:36Z","closed_at":null,"body":"The use-case that I'm running into is this: Using a unique slug as my URL parameter, but making my server calls based on an `id`.  So when I go to `https://mysite.com/unique-readable-slug-1` I can use the URL parameter to get the data from the store if it's there (without making another request), but, if it's not there, make my API call using the *actual* primary key (e.g. `https://my-api.com/thing/12345`). \r\n\r\nI'm in a situation where I can't really change the API endpoint, but I'd really prefer to not use `id` as the URL parameter and it seems silly to have to make an http request for data that I may already have. I understand that Em-D isn't interested in implementing full query support on the store, but I think this could be a compelling enough use-case to merit some consideration (particularly taking into account SEO concerns).\r\n\r\nSo, would it be feasible to allow an option to be passed to the `store.findRecord()` method that would allow the user to specify the lookup key? e.g. `this.store.findRecord('thing', params.slug, { onKey: 'slug' });` or even just exposing a method that would return an `id` based on another attribute, e.g. `this.store.getIdByAttribute({'slug': 'some-slug'})` that could then be passed to `store.findRecord()`.\r\n\r\nOr maybe this already exists and I just don't know about it."}}