Firestore's DocumentSnapshot exposes timestamps such as createTime, readTime, and updateTime. It would be beneficial to expose these timestamps in Fireorm entities, allowing users to access metadata about document operations.
Steps to Reproduce
Retrieve a document using Fireorm.
Attempt to access timestamps like createTime, readTime, and updateTime.
Expected Behavior
Ability to access createTime, readTime, and updateTime directly from Fireorm entities.
Actual Behavior
Currently, these timestamps are not exposed in Fireorm entities.
Acceptance Criteria
Implement a mechanism to expose createTime, readTime, and updateTime in Fireorm entities.
Ensure the implementation is clean and does not require adding arbitrary fields to entities unless needed.
Additional Context
May 3, 2020: Initial issue raised to expose timestamps from DocumentSnapshot.
May 10, 2020: Discussion on the best approach to implement this feature, considering the use of decorators or Symbols for a clean implementation.
Proposed API Changes
Use of Decorators:
Introduce decorators to map entity fields to autogenerated or readonly fields in Firestore.
Description
Firestore's
DocumentSnapshot
exposes timestamps such ascreateTime
,readTime
, andupdateTime
. It would be beneficial to expose these timestamps in Fireorm entities, allowing users to access metadata about document operations.Steps to Reproduce
createTime
,readTime
, andupdateTime
.Expected Behavior
Ability to access
createTime
,readTime
, andupdateTime
directly from Fireorm entities.Actual Behavior
Currently, these timestamps are not exposed in Fireorm entities.
Acceptance Criteria
createTime
,readTime
, andupdateTime
in Fireorm entities.Additional Context
DocumentSnapshot
.Proposed API Changes
Use of Decorators:
Example:
Use of Symbols:
Example:
Testing and Validation:
Original Issue