elersong / fireorm24

ORM for Firebase Firestore 🔥 updated for 2024
MIT License
1 stars 0 forks source link

Support for Retrieving Model from DocumentSnapshot in Firestore DB Triggers #12

Open elersong opened 2 months ago

elersong commented 2 months ago

Description

There is a need to retrieve a model from the DocumentSnapshot provided by Firestore DB triggers. The current solution involves using plainToClass from class-transformer, but a more integrated approach within Fireorm would be beneficial.

Steps to Reproduce

  1. Set up a Firestore DB trigger.
  2. Attempt to retrieve a model directly from the DocumentSnapshot provided by the trigger.

Expected Behavior

A method within Fireorm that allows easy conversion of DocumentSnapshot to a model, enabling seamless use of Fireorm in Firestore DB triggers.

Actual Behavior

Currently, users need to manually convert the snapshot data to their model using plainToClass.

Acceptance Criteria

Additional Context

Original Issue