You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-09-16 09:36:20 +02:00
[#7067] explain more clearly the DynamicModel caveats
This commit is contained in:
4630
plugins/jsvm/internal/types/generated/types.d.ts
vendored
4630
plugins/jsvm/internal/types/generated/types.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -259,7 +259,9 @@ declare function arrayOf<T>(model: T): Array<T>;
|
||||
/**
|
||||
* DynamicModel creates a new dynamic model with fields from the provided data shape.
|
||||
*
|
||||
* Note that in order to use 0 as double/float initialization number you have to use negative zero (` + "`-0`" + `).
|
||||
* Caveats:
|
||||
* - In order to use 0 as double/float initialization number you have to negate it (` + "`-0`" + `).
|
||||
* - You need to use lowerCamelCase when accessing the model fields (e.g. ` + "`model.roles`" + ` and not ` + "`model.Roles`" + `).
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
@@ -269,7 +271,7 @@ declare function arrayOf<T>(model: T): Array<T>;
|
||||
* age: 0, // int64
|
||||
* totalSpent: -0, // float64
|
||||
* active: false,
|
||||
* roles: [],
|
||||
* Roles: [], // maps to "Roles" in the DB/JSON but the prop would be accessible via "model.roles"
|
||||
* meta: {}
|
||||
* })
|
||||
* ` + "```" + `
|
||||
|
Reference in New Issue
Block a user