Skip to content

Field naming #13534

@RokasGiedrys

Description

@RokasGiedrys

Documentation Issue

Using numbers as name values breaks behaviour, and it's not always immediately obvious. From the documentation, I see that names are always strings, but I think it would be helpful to have a Gotha saying: "Don't use numbers since Payload stores all content as nested JSON, field names must also follow JSON object key rules"

Additional Details

{ "1": "value" }

`const obj - {
1: "value"
};

console.log(obj.1) //Syntax error
console.log(obj['1']); //works fine
`

Metadata

Metadata

Assignees

Labels

area: docsImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions