{"action":"created","issue":{"url":"https://api.github.com/repos/gilf/angular2-indexeddb/issues/27","repository_url":"https://api.github.com/repos/gilf/angular2-indexeddb","labels_url":"https://api.github.com/repos/gilf/angular2-indexeddb/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/gilf/angular2-indexeddb/issues/27/comments","events_url":"https://api.github.com/repos/gilf/angular2-indexeddb/issues/27/events","html_url":"https://github.com/gilf/angular2-indexeddb/issues/27","id":231606938,"number":27,"title":"add record Promise do not have key set.","user":{"login":"pyarun","id":884280,"avatar_url":"https://avatars2.githubusercontent.com/u/884280?v=3","gravatar_id":"","url":"https://api.github.com/users/pyarun","html_url":"https://github.com/pyarun","followers_url":"https://api.github.com/users/pyarun/followers","following_url":"https://api.github.com/users/pyarun/following{/other_user}","gists_url":"https://api.github.com/users/pyarun/gists{/gist_id}","starred_url":"https://api.github.com/users/pyarun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyarun/subscriptions","organizations_url":"https://api.github.com/users/pyarun/orgs","repos_url":"https://api.github.com/users/pyarun/repos","events_url":"https://api.github.com/users/pyarun/events{/privacy}","received_events_url":"https://api.github.com/users/pyarun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-26T11:57:34Z","updated_at":"2017-05-27T11:40:09Z","closed_at":null,"body":"```\r\ndb.createStore(1, (evt) => {\r\n    let objectStore = evt.currentTarget.result.createObjectStore(\r\n          'org', { keyPath: \"id\", autoIncrement: true });\r\n  });\r\n\r\n db.add('org', data).then((item)=>{\r\n      console.log(item);\r\n    }, error=>{\r\n      console.error(error);\r\n    })\r\n```\r\nValue of item:\r\n```\r\n{\r\nkey:undefined,\r\nvalue: {\r\n    name: \"orgname\"\r\n  }\r\n}\r\n```\r\n\r\nValue of key is `undefined`\r\n\r\nHow could i get that.\r\n"},"comment":{"url":"https://api.github.com/repos/gilf/angular2-indexeddb/issues/comments/304446818","html_url":"https://github.com/gilf/angular2-indexeddb/issues/27#issuecomment-304446818","issue_url":"https://api.github.com/repos/gilf/angular2-indexeddb/issues/27","id":304446818,"user":{"login":"gilf","id":1590253,"avatar_url":"https://avatars1.githubusercontent.com/u/1590253?v=3","gravatar_id":"","url":"https://api.github.com/users/gilf","html_url":"https://github.com/gilf","followers_url":"https://api.github.com/users/gilf/followers","following_url":"https://api.github.com/users/gilf/following{/other_user}","gists_url":"https://api.github.com/users/gilf/gists{/gist_id}","starred_url":"https://api.github.com/users/gilf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilf/subscriptions","organizations_url":"https://api.github.com/users/gilf/orgs","repos_url":"https://api.github.com/users/gilf/repos","events_url":"https://api.github.com/users/gilf/events{/privacy}","received_events_url":"https://api.github.com/users/gilf/received_events","type":"User","site_admin":false},"created_at":"2017-05-27T11:40:09Z","updated_at":"2017-05-27T11:40:09Z","body":"In the code example you set the key to be id and not key (keyPath is set to id and it is auto increment). \r\nAs a result, IndexedDB creates a key index on the id property therefore the key property is undefined if you didn't provide it in the data object."}}
{"actor":{"display_login":"gilf"}}