From 1365e54622be449f4a1e3de3afa585c612f9c896 Mon Sep 17 00:00:00 2001 From: Tomasz Mielech Date: Fri, 18 Mar 2022 13:11:57 +0100 Subject: [PATCH] Remove omitempty feature when creating collections --- database_collections_impl.go | 8 ++++---- v2/arangodb/database_collection_opts.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/database_collections_impl.go b/database_collections_impl.go index 2e730cee..1b4e5f79 100644 --- a/database_collections_impl.go +++ b/database_collections_impl.go @@ -106,7 +106,7 @@ type createCollectionOptionsInternal struct { DistributeShardsLike string `json:"distributeShardsLike,omitempty"` DoCompact *bool `json:"doCompact,omitempty"` IndexBuckets int `json:"indexBuckets,omitempty"` - InternalValidatorType int `json:"internalValidatorType,omitempty"` + InternalValidatorType int `json:"internalValidatorType"` IsDisjoint bool `json:"isDisjoint,omitempty"` IsSmart bool `json:"isSmart,omitempty"` IsSystem bool `json:"isSystem,omitempty"` @@ -116,8 +116,8 @@ type createCollectionOptionsInternal struct { // Deprecated: use 'WriteConcern' instead MinReplicationFactor int `json:"minReplicationFactor,omitempty"` Name string `json:"name"` - NumberOfShards int `json:"numberOfShards,omitempty"` - ReplicationFactor replicationFactor `json:"replicationFactor,omitempty"` + NumberOfShards int `json:"numberOfShards"` + ReplicationFactor replicationFactor `json:"replicationFactor"` Schema *CollectionSchemaOptions `json:"schema,omitempty"` ShardingStrategy ShardingStrategy `json:"shardingStrategy,omitempty"` ShardKeys []string `json:"shardKeys,omitempty"` @@ -126,7 +126,7 @@ type createCollectionOptionsInternal struct { SyncByRevision bool `json:"syncByRevision,omitempty"` Type CollectionType `json:"type,omitempty"` WaitForSync bool `json:"waitForSync,omitempty"` - WriteConcern int `json:"writeConcern,omitempty"` + WriteConcern int `json:"writeConcern"` } // CreateCollection creates a new collection with given name and options, and opens a connection to it. diff --git a/v2/arangodb/database_collection_opts.go b/v2/arangodb/database_collection_opts.go index 3ca12375..612ebbb0 100644 --- a/v2/arangodb/database_collection_opts.go +++ b/v2/arangodb/database_collection_opts.go @@ -38,7 +38,7 @@ type CreateCollectionOptions struct { // Changes are applied when the collection is loaded the next time. IndexBuckets int `json:"indexBuckets,omitempty"` // Available from 3.9 ArangoD version. - InternalValidatorType int `json:"internalValidatorType,omitempty"` + InternalValidatorType int `json:"internalValidatorType"` // IsDisjoint set isDisjoint flag for Graph. Required ArangoDB 3.7+ IsDisjoint bool `json:"isDisjoint,omitempty"` // Set to create a smart edge or vertex collection. @@ -62,14 +62,14 @@ type CreateCollectionOptions struct { // Deprecated: use 'WriteConcern' instead MinReplicationFactor int `json:"minReplicationFactor,omitempty"` // In a cluster, this value determines the number of shards to create for the collection. In a single server setup, this option is meaningless. (default is 1) - NumberOfShards int `json:"numberOfShards,omitempty"` + NumberOfShards int `json:"numberOfShards"` // ReplicationFactor in a cluster (default is 1), this attribute determines how many copies of each shard are kept on different DBServers. // The value 1 means that only one copy (no synchronous replication) is kept. // A value of k means that k-1 replicas are kept. Any two copies reside on different DBServers. // Replication between them is synchronous, that is, every write operation to the "leader" copy will be replicated to all "follower" replicas, // before the write operation is reported successful. If a server fails, this is detected automatically // and one of the servers holding copies take over, usually without an error being reported. - ReplicationFactor ReplicationFactor `json:"replicationFactor,omitempty"` + ReplicationFactor ReplicationFactor `json:"replicationFactor"` // Schema for collection validation Schema *CollectionSchemaOptions `json:"schema,omitempty"` // This attribute specifies the name of the sharding strategy to use for the collection. @@ -101,7 +101,7 @@ type CreateCollectionOptions struct { // It is required that 1 <= WriteConcern <= ReplicationFactor. // Default is 1. Not available for satellite collections. // Available from 3.6 ArangoDB version. - WriteConcern int `json:"writeConcern,omitempty"` + WriteConcern int `json:"writeConcern"` } // Init translate deprecated fields into current one for backward compatibility