Closed Pawelrutka-bb closed 4 months ago
When using withConverter on collection it do not fetch inner refs
I have custom type
class CalendarModel { owner: DocumentReference // firestore ref min_book_time_min: number book_time_interval_min: number constructor(owner: DocumentReference, min_book_time_min: number, book_time_interval_min: number) { this.owner = owner this.min_book_time_min = min_book_time_min this.book_time_interval_min = book_time_interval_min } }
and converter
const calendarModelConverter = { toFirestore(cal: CalendarModel): firebase.firestore.DocumentData { return { min_book_time_min: cal.min_book_time_min, book_time_interval_min: cal.book_time_interval_min }; }, fromFirestore( snapshot: firebase.firestore.QueryDocumentSnapshot, options: firebase.firestore.SnapshotOptions ): CalendarModel { const data = snapshot.data(options)!; return new CalendarModel(data.owner, data.min_book_time_min, data.book_time_interval_min); } };
and I do
useCollection(collection(db, `facilities/${facility}/calendars`).withConverter<CalendarModel, DocumentData>(calendarModelConverter))
This yields that owner is not getting fetched automatically. Is there a bug or VuewFire API miss use ? If i skip withConverter, data is fetched.
Refs are populated
Refs are not populated
No response
Reproduction
When using withConverter on collection it do not fetch inner refs
Steps to reproduce the bug
I have custom type
and converter
and I do
This yields that owner is not getting fetched automatically. Is there a bug or VuewFire API miss use ? If i skip withConverter, data is fetched.
Expected behavior
Refs are populated
Actual behavior
Refs are not populated
Additional information
No response