-
Hello 👋 , thank you for this amazing library it makes working with Firestore a breeze 🙏 , export type Users = MetaTypeCreator<
{
name: string | PossiblyReadAsUndefined;
age: number | PossiblyReadAsUndefined;
},
'users'
>; when writing the above doc using: const db = getFirestore();
const usersRef = getFirelord<Users>(db, 'users');
setDoc(usersRef.doc('test'), { name: 'helo' }); // shouldnt name be type name | undefined here? 🤔 (excluded) I get the following error: thank you so much 🙇♂️ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
there is no optional field, all fields must have a default value when you create them for the first time using reason behind this design decision:
this is your type export type Users = MetaTypeCreator<
{
name: string | null;
age: number | null;
},
'users'
>; this is your code setDoc(usersRef.doc('test'),{name:'hello', age:null})
|
Beta Was this translation helpful? Give feedback.
there is no optional field, all fields must have a default value when you create them for the first time using
setDoc
reason behind this design decision: