You can codify the shape of documents within your tables by defining a schema.
Convex supports the following types of values:
|Validator for Argument Validation and Schemas||Notes|
|Id||string||string||See Document IDs.|
|Int64||bigint||string (base10)||Int64s only support BigInts between -2^63 and 2^63-1. Convex supports |
|Float64||number||number / string||Convex supports all IEEE-754 double-precision floating point numbers (such as NaNs). Inf and NaN are JSON serialized as strings.|
|String||string||string||Strings are stored as UTF-8 and must be valid Unicode sequences. Strings must be smaller than the 1MB total size limit when encoded as UTF-8.|
|Bytes||ArrayBuffer||string (base64)||Convex supports first class bytestrings, passed in as |
|Array||Array||array||Arrays can have at most 8192 values.|
Every document in Convex has two automatically-generated system fields:
_id: The document ID of the document.
_creationTime: The time this document was created, in milliseconds since the Unix epoch.
Convex values must be less than 1MB in total size. This is an approximate limit for now, but if you're running into these limits and would like a more precise method to calculate a document's size, reach out to us. Documents can have nested values, either objects or arrays that contain other Convex types. Convex types can have at most 16 levels of nesting, and the cumulative size of a nested tree of values must be under the 1MB limit.
Table names may contain alphanumeric characters ("a" to "z", "A" to "Z", and "0" to "9") and underscores ("_"), and they cannot start with an underscore.
If any of these limits don't work for you, let us know!