doc: json doc

Reviewed By: alexsn

Differential Revision: D17475209

fbshipit-source-id: c418f43426cce3fb3b8296a1e274ba3f5bc2a9bc
This commit is contained in:
Ariel Mashraki
2019-09-19 04:58:21 -07:00
committed by Facebook Github Bot
parent c3955a08f1
commit bc5e8316dd

View File

@@ -51,6 +51,7 @@ The following types are currently supported by the framework:
- `string`
- `time.Time`
- `[]byte` (only supported by SQL dialects).
- `JSON` (only supported by SQL dialects) - **experimental**.
<br/>
```go
@@ -81,6 +82,10 @@ func (User) Fields() []ent.Field {
Unique(),
field.Time("created_at").
Default(time.Now),
field.JSON("url", &url.URL{}).
Optional(),
field.JSON("strings", []string{}).
Optional(),
}
}
```