surrealdb / docs.surrealdb.com

The documentation for SurrealDB, powered by Docusaurus
https://surrealdb.com/docs/
70 stars 112 forks source link

Documentation: "Define a Schema" tutorial claims error when undefined field is actually ignored #659

Closed tobin-riff closed 1 month ago

tobin-riff commented 1 month ago

Description

The last sentence in the following is not accurate:

In a schemafull table, since the fields need to be defined before you can populate them, If you add a field that doesn’t exist your data will be ignored. For example, in the user table you have only defined the firstname , lastname and email fields. If you introduce a photoURI field without defining the field in the user table it will return an error.

-- 2: Add a user with all required fields and an undefined one, 'photoURI'.
CREATE user CONTENT {
    firstName: 'John',
    lastName: 'Doe',
    email: 'JohnDoe@someemail.com',
    photoURI: 'photo/yxCFi22Jw2.webp'
};

Recommend we replace "it will return an error" with "an entry will be created without the undefined 'photoURI' field".

Is there an existing issue for this?

Code of Conduct