@@ -87,6 +87,8 @@ type CollectionInfo struct {
8787 Name string `json:"name,omitempty"`
8888 // The status of the collection
8989 Status CollectionStatus `json:"status,omitempty"`
90+ // StatusString represents status as a string.
91+ StatusString string `json:"statusString,omitempty"`
9092 // The type of the collection
9193 Type CollectionType `json:"type,omitempty"`
9294 // If true then the collection is a system collection.
@@ -98,6 +100,7 @@ type CollectionInfo struct {
98100// CollectionProperties contains extended information about a collection.
99101type CollectionProperties struct {
100102 CollectionInfo
103+ ArangoError
101104
102105 // WaitForSync; If true then creating, changing or removing documents will wait until the data has been synchronized to disk.
103106 WaitForSync bool `json:"waitForSync,omitempty"`
@@ -113,7 +116,8 @@ type CollectionProperties struct {
113116 // AllowUserKeys; if set to true, then it is allowed to supply own key values in the _key attribute of a document.
114117 // If set to false, then the key generator is solely responsible for generating keys and supplying own key values in
115118 // the _key attribute of documents is considered an error.
116- AllowUserKeys bool `json:"allowUserKeys,omitempty"`
119+ AllowUserKeys bool `json:"allowUserKeys,omitempty"`
120+ LastValue int64 `json:"lastValue,omitempty"`
117121 } `json:"keyOptions,omitempty"`
118122 // NumberOfShards is the number of shards of the collection.
119123 // Only available in cluster setup.
@@ -123,7 +127,7 @@ type CollectionProperties struct {
123127 ShardKeys []string `json:"shardKeys,omitempty"`
124128 // ReplicationFactor contains how many copies of each shard are kept on different DBServers.
125129 // Only available in cluster setup.
126- ReplicationFactor int `json:"replicationFactor,omitempty "`
130+ ReplicationFactor int `json:"- "`
127131 // Deprecated: use 'WriteConcern' instead
128132 MinReplicationFactor int `json:"minReplicationFactor,omitempty"`
129133 // WriteConcern contains how many copies must be available before a collection can be written.
@@ -149,6 +153,26 @@ type CollectionProperties struct {
149153 SyncByRevision bool `json:"syncByRevision,omitempty"`
150154 // Schema for collection validation
151155 Schema * CollectionSchemaOptions `json:"schema,omitempty"`
156+
157+ Revision string `json:"revision,omitempty"`
158+
159+ // IsDisjoint set isDisjoint flag for Graph. Required ArangoDB 3.7+
160+ IsDisjoint bool `json:"isDisjoint,omitempty"`
161+
162+ IsSmartChild bool `json:"isSmartChild,omitempty"`
163+
164+ InternalValidatorType * int `json:"internalValidatorType, omitempty"`
165+
166+ // Set to create a smart edge or vertex collection.
167+ // This requires ArangoDB Enterprise Edition.
168+ IsSmart bool `json:"isSmart,omitempty"`
169+
170+ // StatusString represents status as a string.
171+ StatusString string `json:"statusString,omitempty"`
172+
173+ TempObjectId string `json:"tempObjectId,omitempty"`
174+
175+ ObjectId string `json:"objectId,omitempty"`
152176}
153177
154178const (
@@ -195,6 +219,9 @@ const (
195219
196220// CollectionStatistics contains the number of documents and additional statistical information about a collection.
197221type CollectionStatistics struct {
222+ ArangoError
223+ CollectionProperties
224+
198225 //The number of documents currently present in the collection.
199226 Count int64 `json:"count,omitempty"`
200227 // The maximal size of a journal or datafile in bytes.
@@ -269,129 +296,9 @@ type CollectionStatistics struct {
269296
270297// CollectionShards contains shards information about a collection.
271298type CollectionShards struct {
272- CollectionInfo
273-
274- // CacheEnabled set cacheEnabled option in collection properties
275- CacheEnabled bool `json:"cacheEnabled,omitempty"`
276-
277- // Set to create a smart edge or vertex collection.
278- // This requires ArangoDB Enterprise Edition.
279- IsSmart bool `json:"isSmart,omitempty"`
280-
281- KeyOptions struct {
282- // Type specifies the type of the key generator. The currently available generators are traditional and autoincrement.
283- Type KeyGeneratorType `json:"type,omitempty"`
284- // AllowUserKeys; if set to true, then it is allowed to supply own key values in the _key attribute of a document.
285- // If set to false, then the key generator is solely responsible for generating keys and supplying own key values in
286- // the _key attribute of documents is considered an error.
287- AllowUserKeys bool `json:"allowUserKeys,omitempty"`
288- } `json:"keyOptions,omitempty"`
289-
290- // Deprecated: use 'WriteConcern' instead.
291- MinReplicationFactor int `json:"minReplicationFactor,omitempty"`
292-
293- // NumberOfShards is the number of shards of the collection.
294- // Only available in cluster setup.
295- NumberOfShards int `json:"numberOfShards,omitempty"`
296-
297- // This attribute specifies the name of the sharding strategy to use for the collection.
298- // Can not be changed after creation.
299- ShardingStrategy ShardingStrategy `json:"shardingStrategy,omitempty"`
300-
301- // ShardKeys contains the names of document attributes that are used to determine the target shard for documents.
302- // Only available in cluster setup.
303- ShardKeys []string `json:"shardKeys,omitempty"`
304-
305- // Shards is a list of shards that belong to the collection.
306- // Each shard contains a list of DB servers where the first one is the leader and the rest are followers.
307- Shards map [ShardID ][]ServerID `json:"shards,omitempty"`
308-
309- // StatusString represents status as a string.
310- StatusString string `json:"statusString,omitempty"`
311-
312- // ReplicationFactor contains how many copies of each shard are kept on different DBServers.
313- // Only available in cluster setup.
314- ReplicationFactor int `json:"replicationFactor,omitempty"`
315-
316- // WaitForSync; If true then creating, changing or removing documents will wait
317- // until the data has been synchronized to disk.
318- WaitForSync bool `json:"waitForSync,omitempty"`
319-
320- // WriteConcern contains how many copies must be available before a collection can be written.
321- // It is required that 1 <= WriteConcern <= ReplicationFactor.
322- // Default is 1. Not available for satellite collections.
323- // Available from 3.6 ArangoDB version.
324- WriteConcern int `json:"writeConcern,omitempty"`
325- }
326-
327- type collectionShardsInternal struct {
328- CollectionInfo
329-
330- // CacheEnabled set cacheEnabled option in collection properties
331- CacheEnabled bool `json:"cacheEnabled,omitempty"`
332-
333- // Set to create a smart edge or vertex collection.
334- // This requires ArangoDB Enterprise Edition.
335- IsSmart bool `json:"isSmart,omitempty"`
336-
337- KeyOptions struct {
338- // Type specifies the type of the key generator. The currently available generators are traditional and autoincrement.
339- Type KeyGeneratorType `json:"type,omitempty"`
340- // AllowUserKeys; if set to true, then it is allowed to supply own key values in the _key attribute of a document.
341- // If set to false, then the key generator is solely responsible for generating keys and supplying own key values in
342- // the _key attribute of documents is considered an error.
343- AllowUserKeys bool `json:"allowUserKeys,omitempty"`
344- } `json:"keyOptions,omitempty"`
345-
346- // Deprecated: use 'WriteConcern' instead.
347- MinReplicationFactor int `json:"minReplicationFactor,omitempty"`
348-
349- // NumberOfShards is the number of shards of the collection.
350- // Only available in cluster setup.
351- NumberOfShards int `json:"numberOfShards,omitempty"`
352-
353- // This attribute specifies the name of the sharding strategy to use for the collection.
354- // Can not be changed after creation.
355- ShardingStrategy ShardingStrategy `json:"shardingStrategy,omitempty"`
356-
357- // ShardKeys contains the names of document attributes that are used to determine the target shard for documents.
358- // Only available in cluster setup.
359- ShardKeys []string `json:"shardKeys,omitempty"`
299+ CollectionProperties
360300
361301 // Shards is a list of shards that belong to the collection.
362302 // Each shard contains a list of DB servers where the first one is the leader and the rest are followers.
363303 Shards map [ShardID ][]ServerID `json:"shards,omitempty"`
364-
365- // StatusString represents status as a string.
366- StatusString string `json:"statusString,omitempty"`
367-
368- // ReplicationFactor contains how many copies of each shard are kept on different DBServers.
369- // Only available in cluster setup.
370- ReplicationFactor replicationFactor `json:"replicationFactor,omitempty"`
371-
372- // WaitForSync; If true then creating, changing or removing documents will wait
373- // until the data has been synchronized to disk.
374- WaitForSync bool `json:"waitForSync,omitempty"`
375-
376- // WriteConcern contains how many copies must be available before a collection can be written.
377- // It is required that 1 <= WriteConcern <= ReplicationFactor.
378- // Default is 1. Not available for satellite collections.
379- // Available from 3.6 ArangoDB version.
380- WriteConcern int `json:"writeConcern,omitempty"`
381- }
382-
383- func (p * CollectionShards ) fromInternal (i collectionShardsInternal ) {
384- p .CollectionInfo = i .CollectionInfo
385- p .CacheEnabled = i .CacheEnabled
386- p .IsSmart = i .IsSmart
387- p .KeyOptions = i .KeyOptions
388- p .MinReplicationFactor = i .MinReplicationFactor
389- p .NumberOfShards = i .NumberOfShards
390- p .ShardingStrategy = i .ShardingStrategy
391- p .ShardKeys = i .ShardKeys
392- p .Shards = i .Shards
393- p .StatusString = i .StatusString
394- p .ReplicationFactor = int (i .ReplicationFactor )
395- p .WaitForSync = i .WaitForSync
396- p .WriteConcern = i .WriteConcern
397304}
0 commit comments