Indexes with spaces not scanning
When trying to define an index with a field that has a space, I get the following error:
4 Replies
Oof sorry for the unhelpful error message -- the issue is that all fields in indexes must be valid identifiers (alphanumeric +
_
strings that do not start with a number).
So if you're able to rename your fields to FirstName
(or First_Name
), I believe the index definition should work (and hopefully that first index definition with Catalog
and Subject
works for you).
We'll look into improving the error message here as well as improving documentationIs there a way to rename fields in the dashboard? I tried but the only thing I could find was clearing and reuploading via the cli which not ideal
Hmm not sure if there's a way to bulk edit fields in the dashboard. I've done this type of rename before by writing a mutation that loads my documents and runs a
db.patch
or db.replace
and run it from the "Functions" page on the dashboardhttps://stack.convex.dev/migrating-data-with-mutations has some useful helpers, especially if you already have a lot of data
Migrating Data With Mutations
Using mutations to migrate data in Convex.