Validate Data before Inserting into Firestore. #116
Closed
KartikBazzad
started this conversation in
General
Replies: 1 comment
-
|
Your message is a bit confusing. I don't quite understand what you mean. Please revise your code example and describe in more detail what is not working. I know Firestore well and can help you then. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In firestore we can do partial data update, like
`
export const NewUserType = object({
name: string(),
email: string("Your email must be a string.", [
minLength(1, "Please enter your email."),
email("The email address is badly formatted."),
]),
status: UserStatus,
isEmailVerified: boolean(),
photoURL: NullUrlSchema,
website: NullUrlSchema,
});
`
in firestore i can do doc().update({website:"url"});
When inserting this data, i want to validate this, but its giving invalid type errors, saying other fields are undefined.
Beta Was this translation helpful? Give feedback.
All reactions