diff --git a/document.go b/document.go index d5a24b19617..db616f9f080 100644 --- a/document.go +++ b/document.go @@ -25,6 +25,7 @@ type Document struct { // data in the meta should be indexed and queryable. type DocumentMeta struct { Name string `json:"name"` + Type string `json:"type,omitempty"` Version string `json:"version,omitempty"` } diff --git a/http/document_test.go b/http/document_test.go index ee8d8ec8ca6..f8f3b2c5325 100644 --- a/http/document_test.go +++ b/http/document_test.go @@ -47,6 +47,7 @@ var ( ID: doc1ID, Meta: influxdb.DocumentMeta{ Name: "doc1", + Type: "typ1", }, Content: "content1", Labels: []*influxdb.Label{ @@ -75,6 +76,7 @@ var ( ID: doc4ID, Meta: influxdb.DocumentMeta{ Name: "doc4", + Type: "typ4", }, Content: "content4", } @@ -122,7 +124,8 @@ var ( } ], "meta": { - "name": "doc1" + "name": "doc1", + "type": "typ1" } }, { diff --git a/http/swagger.yml b/http/swagger.yml index 18f4f35c7fe..54546d143c9 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -7022,6 +7022,8 @@ components: properties: name: type: string + type: + type: string version: type: string required: diff --git a/testing/document.go b/testing/document.go index 277fbac192c..0bb0a2088d4 100644 --- a/testing/document.go +++ b/testing/document.go @@ -61,6 +61,7 @@ func NewDocumentIntegrationTest(store kv.Store) func(t *testing.T) { d1 = &influxdb.Document{ Meta: influxdb.DocumentMeta{ Name: "i1", + Type: "type1", }, Content: map[string]interface{}{ "v1": "v1",