You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-4
Original file line number
Diff line number
Diff line change
@@ -108,9 +108,9 @@ The loader will also automatically convert the value into a slug to be easily us
108
108
It's recommended to use e.g. the title of the entry to be easily searchable and readable.
109
109
**Do not use e.g. rich text fields as ids.**
110
110
111
-
### Improved type safety
111
+
### Improved types
112
112
113
-
By default PocketBase reports `number` and `boolean` fields as not required.
113
+
By default PocketBase reports `number` and `boolean` fields as not required, even though the API will always return at least `0` and `false` respectively.
114
114
This means that the loader will add `undefined` to the type of these fields.
115
115
If you want to enforce that these fields are always present, you can set the `improveTypes` option to `true`.
116
116
@@ -123,8 +123,7 @@ const blog = defineCollection({
123
123
});
124
124
```
125
125
126
-
This will remove `undefined` from the type of these fields and provide default values with `0` and `false` respectively.
127
-
PocketBase will also use these default values when creating new entries in the dashboard.
126
+
This will remove `undefined` from the type of these fields and mark them as required.
* Whether to improve the types of the generated schema.
70
-
* This includes providing `0` or `false` as default values for number and boolean fields, respectively.
71
-
* With this option enabled, the schema will not generate `undefined` as possible value for number and boolean fields.
70
+
* With this option enabled, the schema will not include `undefined` as possible value for number and boolean fields and mark them as required.
72
71
*
73
72
* Why do we need this option?
74
-
* PocketBase does use these values as the default values, even though it's not specified in the schema.
73
+
* The PocketBase API does always return at least `0` or `false` as the default values, even though the fields are not marked as required in the schema.
0 commit comments