Imported a json with ints but convex converts them into floats

Hi, when I changed the type of my id in my schema from float64 to int64 to reduce the storage my DB takes I got this error:
@weatherio/city-data:dev: × Schema validation failed
@weatherio/city-data:dev: Document with ID "j5700019cxm46436xjz5121p7x6jnzj3" in table "search" does not match the schema: Value does not match validator.
@weatherio/city-data:dev: Path: .id
@weatherio/city-data:dev: Value: 2861579.0
@weatherio/city-data:dev: Validator: v.int64()
@weatherio/city-data:dev: × Schema validation failed
@weatherio/city-data:dev: Document with ID "j5700019cxm46436xjz5121p7x6jnzj3" in table "search" does not match the schema: Value does not match validator.
@weatherio/city-data:dev: Path: .id
@weatherio/city-data:dev: Value: 2861579.0
@weatherio/city-data:dev: Validator: v.int64()
even though I imported a json where this exact city has an int value.
No description
1 Reply
Michal Srb
Michal Srb12mo ago
float64 and int64 take up the same amount of space (64 bits, but documents are rounded up to 1KB) And indeed existing floats will not satisfy int64, you'd have to perform a migration: https://docs.convex.dev/production#making-safe-changes
Deploying Your App to Production | Convex Developer Hub
Convex is built to serve live, production app traffic. Here we cover how to

Did you find this page helpful?