From bc5e8316dd19f0170f5c4bdfddc9685cd7bf3ccb Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Thu, 19 Sep 2019 04:58:21 -0700 Subject: [PATCH] doc: json doc Reviewed By: alexsn Differential Revision: D17475209 fbshipit-source-id: c418f43426cce3fb3b8296a1e274ba3f5bc2a9bc --- doc/md/schema-fields.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/md/schema-fields.md b/doc/md/schema-fields.md index 3b6ba2fa2..97c713a2d 100755 --- a/doc/md/schema-fields.md +++ b/doc/md/schema-fields.md @@ -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**.
```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(), } } ```