bug(orderedReducer): deleting a sub-collection causes a TypeError
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What is the current behavior?
When I try to delete a doc in a sub-collection using object or string notation, I get a TypeError: Cannot read property 'map' of undefined
. Although the sub-collection is deleted, my program stops.
props.firestore
.delete({
collection: 'teams',
doc: 'nOAjBoHrtCY7xH0hi0Io',
subcollections: [
{
collection: 'test',
doc: 'VUnVU8MDp0uBYo9KAfnW'
}
]
})
// OR
props.firestore.delete('teams/nOAjBoHrtCY7xH0hi0Io/test/VUnVU8MDp0uBYo9KAfnW')
TypeError: Cannot read property 'map' of undefined
at updateItemInArray (reducers.js:98)
at Object.removeDoc (orderedReducer.js:100)
at reducer (reducers.js:123)
at Object.orderedReducer [as ordered] (orderedReducer.js:196)
at reducers.js:54
at Array.reduce (<anonymous>)
at reducers.js:53
at index.js:26
at Array.reduce (<anonymous>)
at push../node_modules/reduce-reducers/es/index.js.__webpack_exports__.default (index.js:25)
at combination (redux.js:446)
at p (<anonymous>:1:36402)
at v (<anonymous>:1:36684)
at <anonymous>:1:40069
at Object.dispatch (redux.js:205)
at e (<anonymous>:1:40553)
at actions.js:69
Which versions of dependencies, and which browser are affected by this issue? Did this work in previous versions or setups?
"react-redux-firebase": "^2.2.6",
"redux-firestore": "^0.6.1"
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
bug(reducers): updates to arrays inside documents don't work ...
I have a similar behaviour with objects in a document (instead of an array) when removing a property. Example : const documentUpdate =...
Read more >Batch delete documents of a subcollection error: TypeError
I am trying to batch delete a document of a subcollection. There are times when I might need to delete the same product...
Read more >Deleting data | Firestore - Google Cloud
When you delete a document, Firestore does not automatically delete the documents within its subcollections. You can still access the subcollection ...
Read more >redux-firebase/Lobby - Gitter
I have done stress test with react-virtualized but seem not to be an issue as each render take only 5 ms max, from...
Read more >Deletion of sub collections of documents - Google Groups
It seems I have deleted the parents but their subcollection documents remain. How can I delete sub-collection documents which do not have parent...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Wgil Always open to help and PRs! The alpha branch contains the current progress on the work outlined in the v1.0.0 Roadmap.
So for help, things I could use:
npm i --save redux-firestore@alpha
)@prescottprue Just updated the description with the link to the demo. Is there any way I can contribute with the library?