{"action":"opened","issue":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5175","repository_url":"https://api.github.com/repos/pouchdb/pouchdb","labels_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5175/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5175/comments","events_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5175/events","html_url":"https://github.com/pouchdb/pouchdb/issues/5175","id":155675914,"number":5175,"title":"Attachments empty after storing in Android","user":{"login":"RonCan","id":4863594,"avatar_url":"https://avatars.githubusercontent.com/u/4863594?v=3","gravatar_id":"","url":"https://api.github.com/users/RonCan","html_url":"https://github.com/RonCan","followers_url":"https://api.github.com/users/RonCan/followers","following_url":"https://api.github.com/users/RonCan/following{/other_user}","gists_url":"https://api.github.com/users/RonCan/gists{/gist_id}","starred_url":"https://api.github.com/users/RonCan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RonCan/subscriptions","organizations_url":"https://api.github.com/users/RonCan/orgs","repos_url":"https://api.github.com/users/RonCan/repos","events_url":"https://api.github.com/users/RonCan/events{/privacy}","received_events_url":"https://api.github.com/users/RonCan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-19T08:01:35Z","updated_at":"2016-05-19T08:01:35Z","closed_at":null,"body":"I'm using the following code to persist docs with attachments:\r\n\r\n`      for (var i = 0; i < results.length; i++) {\r\n        blobUtil.imgSrcToBlob(results[i]).then(this.gotBlob).catch(function (err) {\r\n          // image failed to load\r\n        });\r\n        // console.log('Image URI: ' + results[i]);\r\n      }\r\n\r\n//gotBlob func\r\n  gotBlob(blob) {\r\n    var text = \"\";\r\n    var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\r\n    for( var i=0; i < 7; i++ )\r\n    text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\r\n    this.claim._attachments[text+\".png\"] = {\r\n      content_type: blob.type,\r\n      data: blob\r\n    }\r\n    // ladies and gents, we have a blob\r\n    this.photos.push(blobUtil.createObjectURL(blob));\r\n    console.log(this.photos);\r\n  }\r\n\r\n// Built the claim object with attachments, now persist\r\n\r\nreturn this._db.post(claim);\r\n`\r\nI can see the claim object with attachments before persisting but after I persist and retrieve using\r\n\r\n`return this._db.allDocs({ include_docs: true, attachments: true})`\r\n\r\nI can see the _attachments key but it's empty, what am I doing wrong?\r\n"}}