Handle Undefined Values by Setting Them as Null #19
Labels
enhancement
New feature or request
from_willyovale
An issue described in original project, but never implemented
good first issue
Good for newcomers
Description
To improve query capabilities and data consistency in Fireorm, undefined values in a collection should be set to null. This change would allow querying those values using
Where
clauses. Additionally, theIFirestoreVal
type should be extended to allow null values.Steps to Reproduce
Expected Behavior
Undefined fields should be stored as null in Firestore, allowing queries to include conditions on these null values.
Actual Behavior
Undefined fields are not stored, making it impossible to query for documents based on undefined values.
Acceptance Criteria
serializeEntity
function to set undefined values as null before writing data to Firestore.IFirestoreVal
type to include null.Where
clauses works as expected.Additional Context
Proposed API Changes
Modify serializeEntity Function:
serializeEntity
function to convert undefined values to null before saving to Firestore.Extend IFirestoreVal Type:
IFirestoreVal
type def to include nullQuerying Null Values:
Example Usage
Original Issue
The text was updated successfully, but these errors were encountered: