Skip to content

[Feat] Add batch function and a collection document delete logic, FirestoreMethod type

Choose a tag to compare

@SHcommit SHcommit released this 08 May 15:41
· 28 commits to master since this release

[Feautre]

  • Implemented logic to delete all documents in a collection using batch.
  • improved, including saving some redundant logic using Combine+extension.
  • Previously, when receiving collection documents, the endpoints response DTO type was specified as a single type even if it had to be received as an array, but now it must be specified as an array. 🤩

[Example]

  1. When deleting all documents in a collection, set the FirestoreMethod type to deleteADocument.
  2. And then, call a request(endpoint:) func using FirestoreService object ! delete it.
  3. Before deletion, FirestoreAccessible's documentRef must be nil and collectionRef must be specified as the deletion target path in the endpoint.

References:

  • Firebase Document link
  • Firebase | WriteBatch document link