1
1
//
2
2
// DISCLAIMER
3
3
//
4
- // Copyright 2017 ArangoDB GmbH, Cologne, Germany
4
+ // Copyright 2017-2023 ArangoDB GmbH, Cologne, Germany
5
5
//
6
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
7
// you may not use this file except in compliance with the License.
17
17
//
18
18
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19
19
//
20
- // Author Ewout Prangsma
21
- //
22
20
23
21
package driver
24
22
@@ -67,6 +65,7 @@ type CollectionDocuments interface {
67
65
// To return the OLD document, prepare a context with `WithReturnOld`.
68
66
// To wait until document has been synced to disk, prepare a context with `WithWaitForSync`.
69
67
// If no document exists with given key, a NotFoundError is returned.
68
+ // If `_id` field is present in the document body, it is always ignored.
70
69
UpdateDocument (ctx context.Context , key string , update interface {}) (DocumentMeta , error )
71
70
72
71
// UpdateDocuments updates multiple document with given keys in the collection.
@@ -75,7 +74,8 @@ type CollectionDocuments interface {
75
74
// To return the OLD documents, prepare a context with `WithReturnOld` with a slice of documents.
76
75
// To wait until documents has been synced to disk, prepare a context with `WithWaitForSync`.
77
76
// If no document exists with a given key, a NotFoundError is returned at its errors index.
78
- // If keys is nil, each element in the updates slice must contain a `_key` field.
77
+ // If keys are nil, each element in the update slice must contain a `_key` field.
78
+ // If `_id` field is present in the document body, it is always ignored.
79
79
UpdateDocuments (ctx context.Context , keys []string , updates interface {}) (DocumentMetaSlice , ErrorSlice , error )
80
80
81
81
// ReplaceDocument replaces a single document with given key in the collection with the document given in the document argument.
@@ -84,6 +84,7 @@ type CollectionDocuments interface {
84
84
// To return the OLD document, prepare a context with `WithReturnOld`.
85
85
// To wait until document has been synced to disk, prepare a context with `WithWaitForSync`.
86
86
// If no document exists with given key, a NotFoundError is returned.
87
+ // If `_id` field is present in the document body, it is always ignored.
87
88
ReplaceDocument (ctx context.Context , key string , document interface {}) (DocumentMeta , error )
88
89
89
90
// ReplaceDocuments replaces multiple documents with given keys in the collection with the documents given in the documents argument.
@@ -93,6 +94,7 @@ type CollectionDocuments interface {
93
94
// To wait until documents has been synced to disk, prepare a context with `WithWaitForSync`.
94
95
// If no document exists with a given key, a NotFoundError is returned at its errors index.
95
96
// If keys is nil, each element in the documents slice must contain a `_key` field.
97
+ // If `_id` field is present in the document body, it is always ignored.
96
98
ReplaceDocuments (ctx context.Context , keys []string , documents interface {}) (DocumentMetaSlice , ErrorSlice , error )
97
99
98
100
// RemoveDocument removes a single document with given key from the collection.
0 commit comments