-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcouchbase-document-schema.json
More file actions
112 lines (112 loc) · 3.25 KB
/
Copy pathcouchbase-document-schema.json
File metadata and controls
112 lines (112 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://couchbase.com/schemas/couchbase/document.json",
"title": "Couchbase Document",
"description": "Schema representing a Couchbase document with metadata fields used across Server, Sync Gateway, and Capella APIs.",
"type": "object",
"properties": {
"_id": {
"type": "string",
"description": "Unique document identifier within the bucket or collection"
},
"_rev": {
"type": "string",
"description": "Revision identifier in Sync Gateway format (generation-digest)",
"pattern": "^\\d+-[a-f0-9]+$"
},
"_deleted": {
"type": "boolean",
"description": "Indicates whether the document is a deletion tombstone",
"default": false
},
"_exp": {
"type": "integer",
"description": "Document expiration time as a Unix timestamp in seconds (0 means no expiry)",
"minimum": 0
},
"_attachments": {
"type": "object",
"description": "Map of attachment names to attachment metadata",
"additionalProperties": {
"$ref": "#/$defs/Attachment"
}
},
"_sync": {
"type": "object",
"description": "Sync Gateway metadata (internal, not typically user-facing)",
"properties": {
"rev": {
"type": "string",
"description": "Current revision"
},
"sequence": {
"type": "integer",
"description": "Sync sequence number"
},
"recent_sequences": {
"type": "array",
"description": "Recent sequence numbers",
"items": {
"type": "integer"
}
},
"history": {
"type": "object",
"description": "Revision history"
},
"channels": {
"type": "object",
"description": "Channel assignments for this document"
},
"access": {
"type": "object",
"description": "User access grants from this document"
},
"role_access": {
"type": "object",
"description": "Role access grants from this document"
}
}
}
},
"additionalProperties": true,
"$defs": {
"Attachment": {
"type": "object",
"description": "Document attachment metadata",
"properties": {
"content_type": {
"type": "string",
"description": "MIME type of the attachment"
},
"digest": {
"type": "string",
"description": "Content digest hash of the attachment"
},
"length": {
"type": "integer",
"description": "Size of the attachment in bytes",
"minimum": 0
},
"revpos": {
"type": "integer",
"description": "Revision generation when the attachment was added",
"minimum": 1
},
"stub": {
"type": "boolean",
"description": "Whether this is a stub reference (true) or contains inline data (false)"
},
"data": {
"type": "string",
"description": "Base64-encoded attachment data (only present when not a stub)",
"contentEncoding": "base64"
}
},
"required": [
"content_type",
"length"
]
}
}
}