{"action":"created","issue":{"url":"https://api.github.com/repos/prescottprue/redux-firestore/issues/120","repository_url":"https://api.github.com/repos/prescottprue/redux-firestore","labels_url":"https://api.github.com/repos/prescottprue/redux-firestore/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/prescottprue/redux-firestore/issues/120/comments","events_url":"https://api.github.com/repos/prescottprue/redux-firestore/issues/120/events","html_url":"https://github.com/prescottprue/redux-firestore/issues/120","id":343000750,"node_id":"MDU6SXNzdWUzNDMwMDA3NTA=","number":120,"title":"Adding a subcollection","user":{"login":"tebogos","id":13760115,"node_id":"MDQ6VXNlcjEzNzYwMTE1","avatar_url":"https://avatars0.githubusercontent.com/u/13760115?v=4","gravatar_id":"","url":"https://api.github.com/users/tebogos","html_url":"https://github.com/tebogos","followers_url":"https://api.github.com/users/tebogos/followers","following_url":"https://api.github.com/users/tebogos/following{/other_user}","gists_url":"https://api.github.com/users/tebogos/gists{/gist_id}","starred_url":"https://api.github.com/users/tebogos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tebogos/subscriptions","organizations_url":"https://api.github.com/users/tebogos/orgs","repos_url":"https://api.github.com/users/tebogos/repos","events_url":"https://api.github.com/users/tebogos/events{/privacy}","received_events_url":"https://api.github.com/users/tebogos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-07-20T07:24:53Z","updated_at":"2018-07-20T18:00:08Z","closed_at":null,"author_association":"NONE","body":"**Do you want to request a *feature* or report a *bug*?**  \r\nbug\r\n\r\nIs it posible to add a subcollection to firestore using redux-firestore?\r\n**What is the current behavior?**\r\nwhen I add a sub document I like the code below:\r\n\r\nwithHandlers({\r\n    startNewProcess: props => () =>\r\n      props.firestore.add(`Region/${region}/office/${id}`, { name:props.name})\r\n})\r\nI have also tried  props.firestore.add({collection:\"Region\",doc:region,subcollections[collection:\"office\"],doc:id}, { name:props.name})\r\nI get the error below:\r\n\r\n Cannot read property 'apply' of undefined\r\n    at wrapInDispatch (actions.js:57)\r\n    at Object.add (firestore.js:52)\r\n    at Object.add (actions.js:92)\r\n    at NewProcessForm.jsx:140\r\n    at Recompose.esm.js:183\r\n    at HTMLUnknownElement.callCallback (react-dom.development.js:100)\r\n    at Object.invokeGuardedCallbackDev (react-dom.development.js:138)\r\n    at Object.invokeGuardedCallback (react-dom.development.js:187)\r\n    at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:201)\r\n    at executeDispatch (react-dom.development.js:461)\r\n    at executeDispatchesInOrder (react-dom.development.js:483)\r\n    at executeDispatchesAndRelease (react-dom.development.js:581)\r\n    at executeDispatchesAndReleaseTopLevel (react-dom.development.js:592)\r\n    at forEachAccumulated (react-dom.development.js:562)\r\n    at runEventsInBatch (react-dom.development.js:723)\r\n    at runExtractedEventsInBatch (react-dom.development.js:732)\r\n    at handleTopLevel (react-dom.development.js:4476)\r\n    at batchedUpdates$1 (react-dom.development.js:16659)\r\n    at batchedUpdates (react-dom.development.js:2131)\r\n    at dispatchEvent (react-dom.development.js:4555)\r\n    at interactiveUpdates$1 (react-dom.development.js:16714)\r\n    at interactiveUpdates (react-dom.development.js:2150)\r\n    at dispatchInteractiveEvent (react-dom.development.js:4532)\r\nwrapInDispatch @ actions.js:57\r\nadd @ firestore.js:52\r\n(anonymous) @ actions.js:92\r\n(anonymous) @ NewProcessForm.jsx:140\r\n(anonymous) @ Recompose.esm.js:183\r\ncallCallback @ react-dom.development.js:100\r\ninvokeGuardedCallbackDev @ react-dom.development.js:138\r\ninvokeGuardedCallback @ react-dom.development.js:187\r\ninvokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:201\r\nexecuteDispatch @ react-dom.development.js:461\r\nexecuteDispatchesInOrder @ react-dom.development.js:483\r\nexecuteDispatchesAndRelease @ react-dom.development.js:581\r\nexecuteDispatchesAndReleaseTopLevel @ react-dom.development.js:592\r\nforEachAccumulated @ react-dom.development.js:562\r\nrunEventsInBatch @ react-dom.development.js:723\r\nrunExtractedEventsInBatch @ react-dom.development.js:732\r\nhandleTopLevel @ react-dom.development.js:4476\r\nbatchedUpdates$1 @ react-dom.development.js:16659\r\nbatchedUpdates @ react-dom.development.js:2131\r\ndispatchEvent @ react-dom.development.js:4555\r\ninteractiveUpdates$1 @ react-dom.development.js:16714\r\ninteractiveUpdates @ react-dom.development.js:2150\r\ndispatchInteractiveEvent @ react-dom.development.js:4532\r\n\r\n\r\n**What is the expected behavior?**\r\nI expect that the data will stored in firestore under the subcollection in the case \"office\" with the id provided.\r\n\r\n**Which versions of dependencies, and which browser are affected by this issue? Did this work in previous versions or setups?**\r\nI am using version 2.\r\n\r\n**Steps to reproduce and if possible a minimal demo of the problem via [codesandbox](https://codesandbox.io/) or similar.**\r\n"},"comment":{"url":"https://api.github.com/repos/prescottprue/redux-firestore/issues/comments/406680398","html_url":"https://github.com/prescottprue/redux-firestore/issues/120#issuecomment-406680398","issue_url":"https://api.github.com/repos/prescottprue/redux-firestore/issues/120","id":406680398,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjY4MDM5OA==","user":{"login":"tebogos","id":13760115,"node_id":"MDQ6VXNlcjEzNzYwMTE1","avatar_url":"https://avatars0.githubusercontent.com/u/13760115?v=4","gravatar_id":"","url":"https://api.github.com/users/tebogos","html_url":"https://github.com/tebogos","followers_url":"https://api.github.com/users/tebogos/followers","following_url":"https://api.github.com/users/tebogos/following{/other_user}","gists_url":"https://api.github.com/users/tebogos/gists{/gist_id}","starred_url":"https://api.github.com/users/tebogos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tebogos/subscriptions","organizations_url":"https://api.github.com/users/tebogos/orgs","repos_url":"https://api.github.com/users/tebogos/repos","events_url":"https://api.github.com/users/tebogos/events{/privacy}","received_events_url":"https://api.github.com/users/tebogos/received_events","type":"User","site_admin":false},"created_at":"2018-07-20T18:00:08Z","updated_at":"2018-07-20T18:00:08Z","author_association":"NONE","body":">When specifiying your own document id at the subcollection level, you can no longer call add since that is for adding documents. If you are trying to update a document at that level you will want to call update like so:\r\n\r\nThank you. You mean that there is no way of specify my own custom document id on a subcollection level?\r\n"}}
{"actor":{"display_login":"tebogos"}}