My issue is the following:
I had a property in a table that I want to have it removed, and as simple as this I just couldn't figure out how to remove the previous fields that were in the database previously
I simply want advice on how to write a function to run once to remove anything that was there previously for that field, I temporarily gave it an "optional",
the schema in question:
export const settingsSchema = {
userId: v.id("users"),
responseType: literals("chat","single-message"),
- theme: v.optional(literals("dark","light")),
keepChat: v.number(), // How long to keep the chats for // max of 30 days
attachments:v.object({
audio: v.boolean(),
images: v.boolean(),
}),
model: literals("gemini-1.0-pro","gemini-1.0-pro-latest","gemini-1.0-pro-001","gemini-1.5-flash","gemini-1.5-flash-latest","gemini-1.5-pro-latest","gemini-1.5-pro"),
languages: literals("ar","bn","bg","zh","hr","cs","da","nl",
"en","et","fi","fr","de","el","iw","hi","hu","id","it","ja",
"ko","lv","lt","no","pl","pt","ro","ru","sr","sk","sl","es",
"sw","sv","th","tr","uk","vi")
}
and the Error Message:
Document with ID "md71n8fp1c83tax5r7q9bg5phn73v75g" in table "settings" does not match the schema: Object contains extra field
themethat is not in the validator.