Skip to content

Removed deprecated code from V2 #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions v2/arangodb/client_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ import (
)

type ClientDatabase interface {
// Deprecated: use GetDatabase instead
//
// Database opens a connection to an existing database.
// If no database with given name exists, an NotFoundError is returned.
Database(ctx context.Context, name string) (Database, error)

// GetDatabase opens a connection to an existing database.
// If no database with given name exists, an NotFoundError is returned.
GetDatabase(ctx context.Context, name string, options *GetDatabaseOptions) (Database, error)
Expand Down
5 changes: 0 additions & 5 deletions v2/arangodb/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ type Collection interface {
// Properties fetches extended information about the collection.
Properties(ctx context.Context) (CollectionProperties, error)

// Deprecated: use 'SetPropertiesV2' instead
//
// SetProperties allows modifying collection parameters
SetProperties(ctx context.Context, options SetCollectionPropertiesOptions) error

// SetProperties allows modifying collection parameters
SetPropertiesV2(ctx context.Context, options SetCollectionPropertiesOptionsV2) error

Expand Down
20 changes: 0 additions & 20 deletions v2/arangodb/collection_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,6 @@ func (c collection) Properties(ctx context.Context) (CollectionProperties, error
}
}

func (c collection) SetProperties(ctx context.Context, options SetCollectionPropertiesOptions) error {
urlEndpoint := c.url("collection", "properties")

var response struct {
shared.ResponseStruct `json:",inline"`
}

resp, err := connection.CallPut(ctx, c.connection(), urlEndpoint, &response, options, c.withModifiers()...)
if err != nil {
return errors.WithStack(err)
}

switch code := resp.Code(); code {
case http.StatusOK:
return nil
default:
return response.AsArangoErrorWithCode(code)
}
}

func (c collection) SetPropertiesV2(ctx context.Context, options SetCollectionPropertiesOptionsV2) error {
urlEndpoint := c.url("collection", "properties")

Expand Down
53 changes: 0 additions & 53 deletions v2/arangodb/collection_indexes.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ type CollectionIndexes interface {
// fields The index is returned, together with a boolean indicating if the index was newly created (true) or pre-existing (false).
EnsureTTLIndex(ctx context.Context, fields []string, expireAfter int, options *CreateTTLIndexOptions) (IndexResponse, bool, error)

// EnsureZKDIndex
// The previously experimental `zkd` index is now stable and has been renamed to `mdi`.
// Existing indexes keep the `zkd` type. The HTTP API still allows the old name to create new indexes that behave
// exactly like `mdi` indexes but this is discouraged. The `zkd` alias may get removed in a future version.
//
// Deprecated: since 3.12 version use EnsureMKDIndex instead.
EnsureZKDIndex(ctx context.Context, fields []string, options *CreateZKDIndexOptions) (IndexResponse, bool, error)

// EnsureMDIIndex creates a multidimensional index for the collection, if it does not already exist.
// The index is returned, together with a boolean indicating if the index was newly created (true) or pre-existing (false).
// Available in ArangoDB 3.12 and later.
Expand Down Expand Up @@ -114,12 +106,6 @@ const (
// Documents which are expired are eventually removed by a background thread.
TTLIndexType = IndexType("ttl")

// ZKDIndexType == multi-dimensional index. The zkd index type is an experimental index for indexing two- or higher dimensional data such as time ranges,
// for efficient intersection of multiple range queries.
//
// Deprecated: since 3.12 version use MDIIndexType instead.
ZKDIndexType = IndexType("zkd")

// MDIIndexType is multidimensional index for indexing two- or higher dimensional data such as time ranges,
// for efficient intersection of multiple range queries.
// Available in ArangoDB 3.12 and later.
Expand All @@ -132,26 +118,6 @@ const (

// InvertedIndexType can be used to speed up a broad range of AQL queries, from simple to complex, including full-text search
InvertedIndexType = IndexType("inverted")

// FullTextIndex
//
// Deprecated: since 3.10 version. Use ArangoSearch view instead.
// It is ued just for the read compatibility with older versions.
FullTextIndex = IndexType("fulltext")

// HashIndex are an aliases for the persistent index type and should no longer be used to create new indexes.
// The aliases will be removed in a future version.
// It is ued just for the read compatibility with older versions.
//
// Deprecated: use PersistentIndexType instead
HashIndex = IndexType("hash")

// SkipListIndex are an aliases for the persistent index type and should no longer be used to create new indexes.
// The aliases will be removed in a future version.
// It is ued just for the read compatibility with older versions.
//
// Deprecated: use PersistentIndexType instead
SkipListIndex = IndexType("skiplist")
)

// IndexResponse is the response from the Index list method
Expand Down Expand Up @@ -302,29 +268,10 @@ type CreateTTLIndexOptions struct {
InBackground *bool `json:"inBackground,omitempty"`
}

// ZKDFieldType
//
// Deprecated: use MDIFieldType instead
type ZKDFieldType string

// ZKDDoubleFieldType
//
// Deprecated: use MDIDoubleFieldType instead
const ZKDDoubleFieldType ZKDFieldType = "double"

type MDIFieldType string

const MDIDoubleFieldType MDIFieldType = "double"

// CreateZKDIndexOptions provides specific options for creating a ZKD index
type CreateZKDIndexOptions struct {
// Name optional user defined name used for hints in AQL queries
Name string `json:"name,omitempty"`

// FieldValueTypes is required and the only allowed value is "double". Future extensions of the index will allow other types.
FieldValueTypes ZKDFieldType `json:"fieldValueTypes,required"`
}

// CreateMDIIndexOptions provides specific options for creating a MKD index
type CreateMDIIndexOptions struct {
// Name optional user defined name used for hints in AQL queries
Expand Down
16 changes: 0 additions & 16 deletions v2/arangodb/collection_indexes_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,6 @@ func (c *collectionIndexes) EnsureTTLIndex(ctx context.Context, fields []string,
return newIndexResponse(&result), created, err
}

func (c *collectionIndexes) EnsureZKDIndex(ctx context.Context, fields []string, options *CreateZKDIndexOptions) (IndexResponse, bool, error) {
reqData := struct {
Type IndexType `json:"type"`
Fields []string `json:"fields"`
*CreateZKDIndexOptions
}{
Type: ZKDIndexType,
Fields: fields,
CreateZKDIndexOptions: options,
}

result := responseIndex{}
created, err := c.ensureIndex(ctx, &reqData, &result)
return newIndexResponse(&result), created, err
}

func (c *collectionIndexes) EnsureMDIIndex(ctx context.Context, fields []string, options *CreateMDIIndexOptions) (IndexResponse, bool, error) {
reqData := struct {
Type IndexType `json:"type"`
Expand Down
61 changes: 0 additions & 61 deletions v2/arangodb/collection_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ type CollectionExtendedInfo struct {
AllowUserKeys bool `json:"allowUserKeys,omitempty"`
} `json:"keyOptions,omitempty"`

// Deprecated: use 'WriteConcern' instead.
MinReplicationFactor int `json:"minReplicationFactor,omitempty"`

// NumberOfShards is the number of shards of the collection.
// Only available in cluster setup.
NumberOfShards int `json:"numberOfShards,omitempty"`
Expand Down Expand Up @@ -125,34 +122,9 @@ type CollectionExtendedInfo struct {
type CollectionProperties struct {
CollectionExtendedInfo

// The number of buckets into which indexes using a hash table are split. The default is 16 and this number has to be a power
// of 2 and less than or equal to 1024. For very large collections one should increase this to avoid long pauses when the hash
// table has to be initially built or resized, since buckets are resized individually and can be initially built in parallel.
// For example, 64 might be a sensible value for a collection with 100 000 000 documents.
// Currently, only the edge index respects this value, but other index types might follow in future ArangoDB versions.
// Changes are applied when the collection is loaded the next time.
//
// Deprecated: since 3.7 version. It is related only to MMFiles.
IndexBuckets int `json:"indexBuckets,omitempty"`

// DoCompact specifies whether or not the collection will be compacted.
//
// Deprecated: since 3.7 version. It is related only to MMFiles.
DoCompact bool `json:"doCompact,omitempty"`

// JournalSize is the maximal size setting for journals / datafiles in bytes.
JournalSize int64 `json:"journalSize,omitempty"`

// If true then the collection data is kept in-memory only and not made persistent.
// Unloading the collection will cause the collection data to be discarded. Stopping or re-starting the server will also
// cause full loss of data in the collection. Setting this option will make the resulting collection be slightly faster
// than regular collections because ArangoDB does not enforce any synchronization to disk and does not calculate any
// CRC checksums for datafiles (as there are no datafiles). This option should therefore be used for cache-type collections only,
// and not for data that cannot be re-created otherwise. (The default is false)
//
// Deprecated: since 3.7 version. It is related only to MMFiles.
IsVolatile bool `json:"isVolatile,omitempty"`

// SmartJoinAttribute
// See documentation for SmartJoins.
// This requires ArangoDB Enterprise Edition.
Expand Down Expand Up @@ -184,37 +156,7 @@ func (p *CollectionProperties) IsSatellite() bool {
return p.ReplicationFactor == ReplicationFactorSatellite
}

// Deprecated: use 'SetCollectionPropertiesOptionsV2' instead
//
// SetCollectionPropertiesOptions contains data for Collection.SetProperties.
type SetCollectionPropertiesOptions struct {
// If true then creating or changing a document will wait until the data has been synchronized to disk.
WaitForSync *bool `json:"waitForSync,omitempty"`

// The maximal size of a journal or datafile in bytes. The value must be at least 1048576 (1 MB). Note that when changing the journalSize value, it will only have an effect for additional journals or datafiles that are created. Already existing journals or datafiles will not be affected.
JournalSize int64 `json:"journalSize,omitempty"`

// ReplicationFactor contains how many copies of each shard are kept on different DBServers.
// Only available in cluster setup.
ReplicationFactor ReplicationFactor `json:"replicationFactor,omitempty"`

// Deprecated: use 'WriteConcern' instead
MinReplicationFactor int `json:"minReplicationFactor,omitempty"`

// WriteConcern contains how many copies must be available before a collection can be written.
// Available from 3.6 arangod version.
WriteConcern int `json:"writeConcern,omitempty"`

// CacheEnabled set cacheEnabled option in collection properties
CacheEnabled *bool `json:"cacheEnabled,omitempty"`

// Schema for collection validation
Schema *CollectionSchemaOptions `json:"schema,omitempty"`

// ComputedValues let configure collections to generate document attributes when documents are created or modified, using an AQL expression
ComputedValues []ComputedValue `json:"computedValues,omitempty"`
}

type SetCollectionPropertiesOptionsV2 struct {
// If true then creating or changing a document will wait until the data has been synchronized to disk.
WaitForSync *bool `json:"waitForSync,omitempty"`
Expand All @@ -226,9 +168,6 @@ type SetCollectionPropertiesOptionsV2 struct {
// Only available in cluster setup.
ReplicationFactor *ReplicationFactor `json:"replicationFactor,omitempty"`

// Deprecated: use 'WriteConcern' instead
MinReplicationFactor *int `json:"minReplicationFactor,omitempty"`

// WriteConcern contains how many copies must be available before a collection can be written.
// Available from 3.6 arangod version.
WriteConcern *int `json:"writeConcern,omitempty"`
Expand Down
6 changes: 0 additions & 6 deletions v2/arangodb/database_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ import (
)

type DatabaseAnalyzer interface {
// Deprecated: Use EnsureCreatedAnalyzer instead
//
// EnsureAnalyzer ensures that the given analyzer exists. If it does not exist, it is created.
// The function returns whether the analyzer already existed or not.
EnsureAnalyzer(ctx context.Context, analyzer *AnalyzerDefinition) (bool, Analyzer, error)

// EnsureCreatedAnalyzer creates an Analyzer for the database, if it does not already exist.
// It returns the Analyser object together with a boolean indicating if the Analyzer was newly created (true) or pre-existing (false).
EnsureCreatedAnalyzer(ctx context.Context, analyzer *AnalyzerDefinition) (Analyzer, bool, error)
Expand Down
21 changes: 0 additions & 21 deletions v2/arangodb/database_analyzer_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,6 @@ type databaseAnalyzer struct {
db *database
}

// Deprecated: Use EnsureCreatedAnalyzer instead
func (d databaseAnalyzer) EnsureAnalyzer(ctx context.Context, analyzer *AnalyzerDefinition) (bool, Analyzer, error) {
urlEndpoint := d.db.url("_api", "analyzer")

var response struct {
shared.ResponseStruct `json:",inline"`
AnalyzerDefinition
}
resp, err := connection.CallPost(ctx, d.db.connection(), urlEndpoint, &response, analyzer)
if err != nil {
return false, nil, errors.WithStack(err)
}

switch code := resp.Code(); code {
case http.StatusCreated, http.StatusOK:
return code == http.StatusOK, newAnalyzer(d.db, response.AnalyzerDefinition), nil
default:
return false, nil, response.AsArangoErrorWithCode(code)
}
}

// EnsureCreatedAnalyzer creates an Analyzer for the database, if it does not already exist.
// It returns the Analyser object together with a boolean indicating if the Analyzer was newly created (true) or pre-existing (false).
func (d databaseAnalyzer) EnsureCreatedAnalyzer(ctx context.Context, analyzer *AnalyzerDefinition) (Analyzer, bool, error) {
Expand Down
18 changes: 0 additions & 18 deletions v2/arangodb/database_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ import (
)

type DatabaseCollection interface {
// Deprecated: use GetCollection instead
//
// Collection opens a connection to an existing collection within the database.
// If no collection with given name exists, an NotFoundError is returned.
Collection(ctx context.Context, name string) (Collection, error)

// GetCollection opens a connection to an existing collection within the database.
// If no collection with given name exists, an NotFoundError is returned.
GetCollection(ctx context.Context, name string, options *GetCollectionOptions) (Collection, error)
Expand All @@ -41,22 +35,10 @@ type DatabaseCollection interface {
// Collections returns a list of all collections in the database.
Collections(ctx context.Context) ([]Collection, error)

// Deprecated: use CreateCollectionV2 instead
//
// CreateCollection creates a new collection with given name and options, and opens a connection to it.
// If a collection with given name already exists within the database, a DuplicateError is returned.
CreateCollection(ctx context.Context, name string, props *CreateCollectionProperties) (Collection, error)

// CreateCollection creates a new collection with given name and options, and opens a connection to it.
// If a collection with given name already exists within the database, a DuplicateError is returned.
CreateCollectionV2(ctx context.Context, name string, props *CreateCollectionPropertiesV2) (Collection, error)

// Deprecated: use CreateCollectionWithOptionsV2 instead
//
// CreateCollectionWithOptions creates a new collection with given name and options, and opens a connection to it.
// If a collection with given name already exists within the database, a DuplicateError is returned.
CreateCollectionWithOptions(ctx context.Context, name string, props *CreateCollectionProperties, options *CreateCollectionOptions) (Collection, error)

// CreateCollectionWithOptions creates a new collection with given name and options, and opens a connection to it.
// If a collection with given name already exists within the database, a DuplicateError is returned.
CreateCollectionWithOptionsV2(ctx context.Context, name string, props *CreateCollectionPropertiesV2, options *CreateCollectionOptions) (Collection, error)
Expand Down
41 changes: 0 additions & 41 deletions v2/arangodb/database_collection_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ type databaseCollection struct {
db *database
}

func (d databaseCollection) Collection(ctx context.Context, name string) (Collection, error) {
return d.GetCollection(ctx, name, nil)
}

func (d databaseCollection) GetCollection(ctx context.Context, name string, options *GetCollectionOptions) (Collection, error) {
col := newCollection(d.db, name)

Expand Down Expand Up @@ -113,47 +109,10 @@ func (d databaseCollection) Collections(ctx context.Context) ([]Collection, erro
}
}

// Deprecated: use CreateCollectionV2 instead
//
// CreateCollectionWithOptions
func (d databaseCollection) CreateCollection(ctx context.Context, name string, props *CreateCollectionProperties) (Collection, error) {
return d.CreateCollectionWithOptions(ctx, name, props, nil)
}

func (d databaseCollection) CreateCollectionV2(ctx context.Context, name string, props *CreateCollectionPropertiesV2) (Collection, error) {
return d.CreateCollectionWithOptionsV2(ctx, name, props, nil)
}

// Deprecated: use CreateCollectionWithOptionsV2 instead
//
// CreateCollectionWithOptions
func (d databaseCollection) CreateCollectionWithOptions(ctx context.Context, name string, props *CreateCollectionProperties, options *CreateCollectionOptions) (Collection, error) {
props.Init()

urlEndpoint := d.db.url("_api", "collection")
reqData := struct {
Name string `json:"name"`
*CreateCollectionProperties
}{
Name: name,
CreateCollectionProperties: props,
}

var respData shared.ResponseStruct

resp, err := connection.CallPost(ctx, d.db.connection(), urlEndpoint, &respData, &reqData, append(d.db.modifiers, options.modifyRequest)...)
if err != nil {
return nil, errors.WithStack(err)
}

switch code := resp.Code(); code {
case http.StatusOK:
return newCollection(d.db, name), nil
default:
return nil, respData.AsArangoErrorWithCode(code)
}
}

func (d databaseCollection) CreateCollectionWithOptionsV2(ctx context.Context, name string, props *CreateCollectionPropertiesV2, options *CreateCollectionOptions) (Collection, error) {
props.Init()

Expand Down
Loading