arangojs 8.7.0 → 8.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -1
- package/README.md +1 -1
- package/analyzer.d.ts +105 -38
- package/analyzer.d.ts.map +1 -1
- package/analyzer.js.map +1 -1
- package/aql.d.ts +1 -1
- package/aql.d.ts.map +1 -1
- package/aql.js.map +1 -1
- package/collection.d.ts +117 -66
- package/collection.d.ts.map +1 -1
- package/collection.js +2 -2
- package/collection.js.map +1 -1
- package/connection.d.ts +19 -19
- package/connection.d.ts.map +1 -1
- package/connection.js +1 -1
- package/connection.js.map +1 -1
- package/cursor.js.map +1 -1
- package/database.d.ts +63 -63
- package/database.d.ts.map +1 -1
- package/database.js +1 -1
- package/database.js.map +1 -1
- package/documents.d.ts +10 -10
- package/documents.d.ts.map +1 -1
- package/documents.js.map +1 -1
- package/error.js.map +1 -1
- package/foxx-manifest.d.ts +4 -4
- package/foxx-manifest.d.ts.map +1 -1
- package/graph.d.ts +11 -11
- package/graph.d.ts.map +1 -1
- package/graph.js.map +1 -1
- package/index.js.map +1 -1
- package/indexes.d.ts +28 -28
- package/indexes.d.ts.map +1 -1
- package/indexes.js +1 -1
- package/indexes.js.map +1 -1
- package/job.js.map +1 -1
- package/lib/errback.d.ts +1 -1
- package/lib/errback.d.ts.map +1 -1
- package/lib/multipart.d.ts +1 -1
- package/lib/multipart.d.ts.map +1 -1
- package/lib/multipart.js.map +1 -1
- package/lib/multipart.web.js.map +1 -1
- package/lib/omit.js.map +1 -1
- package/lib/querystringify.js.map +1 -1
- package/lib/querystringify.web.js.map +1 -1
- package/lib/request.node.d.ts +2 -2
- package/lib/request.node.d.ts.map +1 -1
- package/lib/request.node.js.map +1 -1
- package/lib/request.web.js.map +1 -1
- package/lib/xhr.d.ts +1 -0
- package/lib/xhr.d.ts.map +1 -1
- package/package.json +1 -1
- package/transaction.d.ts +3 -3
- package/transaction.d.ts.map +1 -1
- package/transaction.js.map +1 -1
- package/view.d.ts +24 -24
- package/view.d.ts.map +1 -1
- package/view.js.map +1 -1
- package/web.js +1 -1
- package/web.js.map +1 -1
package/collection.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { ArangoApiResponse } from "./connection";
|
|
|
17
17
|
import { ArrayCursor } from "./cursor";
|
|
18
18
|
import { Database } from "./database";
|
|
19
19
|
import { Document, DocumentData, DocumentMetadata, DocumentSelector, Edge, EdgeData, ObjectWithKey, Patch } from "./documents";
|
|
20
|
-
import { EnsureFulltextIndexOptions, EnsureGeoIndexOptions, EnsureInvertedIndexOptions, EnsurePersistentIndexOptions, EnsureTtlIndexOptions,
|
|
20
|
+
import { EnsureFulltextIndexOptions, EnsureGeoIndexOptions, EnsureInvertedIndexOptions, EnsurePersistentIndexOptions, EnsureTtlIndexOptions, EnsureMdiIndexOptions, FulltextIndex, GeoIndex, Index, IndexSelector, InvertedIndex, PersistentIndex, TtlIndex, MdiIndex } from "./indexes";
|
|
21
21
|
import { Blob } from "./lib/blob";
|
|
22
22
|
/**
|
|
23
23
|
* Indicates whether the given value represents an {@link ArangoCollection}.
|
|
@@ -71,11 +71,11 @@ export declare enum CollectionStatus {
|
|
|
71
71
|
/**
|
|
72
72
|
* Type of key generator.
|
|
73
73
|
*/
|
|
74
|
-
export
|
|
74
|
+
export type KeyGenerator = "traditional" | "autoincrement" | "uuid" | "padded";
|
|
75
75
|
/**
|
|
76
76
|
* Strategy for sharding a collection.
|
|
77
77
|
*/
|
|
78
|
-
export
|
|
78
|
+
export type ShardingStrategy = "hash" | "enterprise-hash-smart-edge" | "enterprise-hash-smart-vertex" | "community-compat" | "enterprise-compat" | "enterprise-smart-edge-compat";
|
|
79
79
|
/**
|
|
80
80
|
* Type of document reference.
|
|
81
81
|
*
|
|
@@ -84,7 +84,7 @@ export declare type ShardingStrategy = "hash" | "enterprise-hash-smart-edge" | "
|
|
|
84
84
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
85
85
|
* replaced with AQL queries.
|
|
86
86
|
*/
|
|
87
|
-
export
|
|
87
|
+
export type SimpleQueryListType = "id" | "key" | "path";
|
|
88
88
|
/**
|
|
89
89
|
* When a validation should be applied.
|
|
90
90
|
*
|
|
@@ -94,15 +94,41 @@ export declare type SimpleQueryListType = "id" | "key" | "path";
|
|
|
94
94
|
* document was already invalid.
|
|
95
95
|
* * `"strict"`: New and modified documents are always validated.
|
|
96
96
|
*/
|
|
97
|
-
export
|
|
97
|
+
export type ValidationLevel = "none" | "new" | "moderate" | "strict";
|
|
98
98
|
/**
|
|
99
99
|
* Write operation that can result in a computed value being computed.
|
|
100
100
|
*/
|
|
101
|
-
export
|
|
101
|
+
export type WriteOperation = "insert" | "update" | "replace";
|
|
102
|
+
/**
|
|
103
|
+
* Represents a bulk operation failure for an individual document.
|
|
104
|
+
*/
|
|
105
|
+
export type DocumentOperationFailure = {
|
|
106
|
+
/**
|
|
107
|
+
* Indicates that the operation failed.
|
|
108
|
+
*/
|
|
109
|
+
error: true;
|
|
110
|
+
/**
|
|
111
|
+
* Human-readable description of the failure.
|
|
112
|
+
*/
|
|
113
|
+
errorMessage: string;
|
|
114
|
+
/**
|
|
115
|
+
* Numeric representation of the failure.
|
|
116
|
+
*/
|
|
117
|
+
errorNum: number;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Metadata returned by a document operation.
|
|
121
|
+
*/
|
|
122
|
+
export type DocumentOperationMetadata = DocumentMetadata & {
|
|
123
|
+
/**
|
|
124
|
+
* Revision of the document that was updated or replaced by this operation.
|
|
125
|
+
*/
|
|
126
|
+
_oldRev?: string;
|
|
127
|
+
};
|
|
102
128
|
/**
|
|
103
129
|
* Properties defining a computed value.
|
|
104
130
|
*/
|
|
105
|
-
export
|
|
131
|
+
export type ComputedValueProperties = {
|
|
106
132
|
/**
|
|
107
133
|
* Name of the target attribute of the computed value.
|
|
108
134
|
*/
|
|
@@ -135,7 +161,7 @@ export declare type ComputedValueProperties = {
|
|
|
135
161
|
/**
|
|
136
162
|
* General information about a collection.
|
|
137
163
|
*/
|
|
138
|
-
export
|
|
164
|
+
export type CollectionMetadata = {
|
|
139
165
|
/**
|
|
140
166
|
* Collection name.
|
|
141
167
|
*/
|
|
@@ -162,7 +188,7 @@ export declare type CollectionMetadata = {
|
|
|
162
188
|
/**
|
|
163
189
|
* An object defining the collection's key generation.
|
|
164
190
|
*/
|
|
165
|
-
export
|
|
191
|
+
export type CollectionKeyProperties = {
|
|
166
192
|
/**
|
|
167
193
|
* Type of key generator to use.
|
|
168
194
|
*/
|
|
@@ -187,7 +213,7 @@ export declare type CollectionKeyProperties = {
|
|
|
187
213
|
/**
|
|
188
214
|
* Properties for validating documents in a collection.
|
|
189
215
|
*/
|
|
190
|
-
export
|
|
216
|
+
export type SchemaProperties = {
|
|
191
217
|
/**
|
|
192
218
|
* Type of document validation.
|
|
193
219
|
*/
|
|
@@ -208,7 +234,7 @@ export declare type SchemaProperties = {
|
|
|
208
234
|
/**
|
|
209
235
|
* An object defining the properties of a collection.
|
|
210
236
|
*/
|
|
211
|
-
export
|
|
237
|
+
export type CollectionProperties = {
|
|
212
238
|
/**
|
|
213
239
|
* A human-readable representation of the collection loading status.
|
|
214
240
|
*/
|
|
@@ -287,7 +313,7 @@ export declare type CollectionProperties = {
|
|
|
287
313
|
/**
|
|
288
314
|
* Options for creating a computed value.
|
|
289
315
|
*/
|
|
290
|
-
export
|
|
316
|
+
export type ComputedValueOptions = {
|
|
291
317
|
/**
|
|
292
318
|
* Name of the target attribute of the computed value.
|
|
293
319
|
*/
|
|
@@ -330,7 +356,7 @@ export declare type ComputedValueOptions = {
|
|
|
330
356
|
/**
|
|
331
357
|
* Options for validating collection documents.
|
|
332
358
|
*/
|
|
333
|
-
export
|
|
359
|
+
export type SchemaOptions = {
|
|
334
360
|
/**
|
|
335
361
|
* JSON Schema description of the validation schema for documents.
|
|
336
362
|
*/
|
|
@@ -351,7 +377,7 @@ export declare type SchemaOptions = {
|
|
|
351
377
|
*
|
|
352
378
|
* See {@link DocumentCollection#properties} and {@link EdgeCollection#properties}.
|
|
353
379
|
*/
|
|
354
|
-
export
|
|
380
|
+
export type CollectionPropertiesOptions = {
|
|
355
381
|
/**
|
|
356
382
|
* Whether data should be synchronized to disk before returning from
|
|
357
383
|
* a document create, update, replace or removal operation.
|
|
@@ -386,7 +412,7 @@ export declare type CollectionPropertiesOptions = {
|
|
|
386
412
|
/**
|
|
387
413
|
* Options for retrieving a collection checksum.
|
|
388
414
|
*/
|
|
389
|
-
export
|
|
415
|
+
export type CollectionChecksumOptions = {
|
|
390
416
|
/**
|
|
391
417
|
* If set to `true`, revision IDs will be included in the calculation
|
|
392
418
|
* of the checksum.
|
|
@@ -405,7 +431,7 @@ export declare type CollectionChecksumOptions = {
|
|
|
405
431
|
/**
|
|
406
432
|
* Options for dropping collections.
|
|
407
433
|
*/
|
|
408
|
-
export
|
|
434
|
+
export type CollectionDropOptions = {
|
|
409
435
|
/**
|
|
410
436
|
* Whether the collection is a system collection. If the collection is a
|
|
411
437
|
* system collection, this option must be set to `true` or ArangoDB will
|
|
@@ -418,7 +444,7 @@ export declare type CollectionDropOptions = {
|
|
|
418
444
|
/**
|
|
419
445
|
* An object defining the collection's key generation.
|
|
420
446
|
*/
|
|
421
|
-
export
|
|
447
|
+
export type CollectionKeyOptions = {
|
|
422
448
|
/**
|
|
423
449
|
* Type of key generator to use.
|
|
424
450
|
*/
|
|
@@ -445,7 +471,7 @@ export declare type CollectionKeyOptions = {
|
|
|
445
471
|
* See {@link database.Database#createCollection}, {@link database.Database#createEdgeCollection}
|
|
446
472
|
* and {@link DocumentCollection#create} or {@link EdgeCollection#create}.
|
|
447
473
|
*/
|
|
448
|
-
export
|
|
474
|
+
export type CreateCollectionOptions = {
|
|
449
475
|
/**
|
|
450
476
|
* If set to `true`, data will be synchronized to disk before returning from
|
|
451
477
|
* a document create, update, replace or removal operation.
|
|
@@ -538,7 +564,7 @@ export declare type CreateCollectionOptions = {
|
|
|
538
564
|
/**
|
|
539
565
|
* Options for checking whether a document exists in a collection.
|
|
540
566
|
*/
|
|
541
|
-
export
|
|
567
|
+
export type DocumentExistsOptions = {
|
|
542
568
|
/**
|
|
543
569
|
* If set to a document revision, the document will only match if its `_rev`
|
|
544
570
|
* matches the given revision.
|
|
@@ -553,7 +579,7 @@ export declare type DocumentExistsOptions = {
|
|
|
553
579
|
/**
|
|
554
580
|
* Options for retrieving a document from a collection.
|
|
555
581
|
*/
|
|
556
|
-
export
|
|
582
|
+
export type CollectionReadOptions = {
|
|
557
583
|
/**
|
|
558
584
|
* If set to `true`, `null` is returned instead of an exception being thrown
|
|
559
585
|
* if the document does not exist.
|
|
@@ -580,7 +606,7 @@ export declare type CollectionReadOptions = {
|
|
|
580
606
|
/**
|
|
581
607
|
* Options for retrieving multiple documents from a collection.
|
|
582
608
|
*/
|
|
583
|
-
export
|
|
609
|
+
export type CollectionBatchReadOptions = {
|
|
584
610
|
/**
|
|
585
611
|
* If set to `true`, the request will explicitly permit ArangoDB to return a
|
|
586
612
|
* potentially dirty or stale result and arangojs will load balance the
|
|
@@ -591,7 +617,7 @@ export declare type CollectionBatchReadOptions = {
|
|
|
591
617
|
/**
|
|
592
618
|
* Options for inserting a new document into a collection.
|
|
593
619
|
*/
|
|
594
|
-
export
|
|
620
|
+
export type CollectionInsertOptions = {
|
|
595
621
|
/**
|
|
596
622
|
* If set to `true`, data will be synchronized to disk before returning.
|
|
597
623
|
*
|
|
@@ -644,11 +670,18 @@ export declare type CollectionInsertOptions = {
|
|
|
644
670
|
* Default: `false`
|
|
645
671
|
*/
|
|
646
672
|
refillIndexCaches?: boolean;
|
|
673
|
+
/**
|
|
674
|
+
* If set, the attribute with the name specified by the option is looked up
|
|
675
|
+
* in the stored document and the attribute value is compared numerically to
|
|
676
|
+
* the value of the versioning attribute in the supplied document that is
|
|
677
|
+
* supposed to update/replace it.
|
|
678
|
+
*/
|
|
679
|
+
versionAttribute?: string;
|
|
647
680
|
};
|
|
648
681
|
/**
|
|
649
682
|
* Options for replacing an existing document in a collection.
|
|
650
683
|
*/
|
|
651
|
-
export
|
|
684
|
+
export type CollectionReplaceOptions = {
|
|
652
685
|
/**
|
|
653
686
|
* If set to `true`, data will be synchronized to disk before returning.
|
|
654
687
|
*
|
|
@@ -696,11 +729,18 @@ export declare type CollectionReplaceOptions = {
|
|
|
696
729
|
* Default: `false`
|
|
697
730
|
*/
|
|
698
731
|
refillIndexCaches?: boolean;
|
|
732
|
+
/**
|
|
733
|
+
* If set, the attribute with the name specified by the option is looked up
|
|
734
|
+
* in the stored document and the attribute value is compared numerically to
|
|
735
|
+
* the value of the versioning attribute in the supplied document that is
|
|
736
|
+
* supposed to update/replace it.
|
|
737
|
+
*/
|
|
738
|
+
versionAttribute?: string;
|
|
699
739
|
};
|
|
700
740
|
/**
|
|
701
741
|
* Options for updating a document in a collection.
|
|
702
742
|
*/
|
|
703
|
-
export
|
|
743
|
+
export type CollectionUpdateOptions = {
|
|
704
744
|
/**
|
|
705
745
|
* If set to `true`, data will be synchronized to disk before returning.
|
|
706
746
|
*
|
|
@@ -763,11 +803,18 @@ export declare type CollectionUpdateOptions = {
|
|
|
763
803
|
* Default: `false`
|
|
764
804
|
*/
|
|
765
805
|
refillIndexCaches?: boolean;
|
|
806
|
+
/**
|
|
807
|
+
* If set, the attribute with the name specified by the option is looked up
|
|
808
|
+
* in the stored document and the attribute value is compared numerically to
|
|
809
|
+
* the value of the versioning attribute in the supplied document that is
|
|
810
|
+
* supposed to update/replace it.
|
|
811
|
+
*/
|
|
812
|
+
versionAttribute?: string;
|
|
766
813
|
};
|
|
767
814
|
/**
|
|
768
815
|
* Options for removing a document from a collection.
|
|
769
816
|
*/
|
|
770
|
-
export
|
|
817
|
+
export type CollectionRemoveOptions = {
|
|
771
818
|
/**
|
|
772
819
|
* If set to `true`, changes will be synchronized to disk before returning.
|
|
773
820
|
*
|
|
@@ -805,7 +852,7 @@ export declare type CollectionRemoveOptions = {
|
|
|
805
852
|
/**
|
|
806
853
|
* Options for bulk importing documents into a collection.
|
|
807
854
|
*/
|
|
808
|
-
export
|
|
855
|
+
export type CollectionImportOptions = {
|
|
809
856
|
/**
|
|
810
857
|
* (Edge collections only.) Prefix to prepend to `_from` attribute values.
|
|
811
858
|
*/
|
|
@@ -849,7 +896,7 @@ export declare type CollectionImportOptions = {
|
|
|
849
896
|
/**
|
|
850
897
|
* Options for retrieving a document's edges from a collection.
|
|
851
898
|
*/
|
|
852
|
-
export
|
|
899
|
+
export type CollectionEdgesOptions = {
|
|
853
900
|
/**
|
|
854
901
|
* If set to `true`, the request will explicitly permit ArangoDB to return a
|
|
855
902
|
* potentially dirty or stale result and arangojs will load balance the
|
|
@@ -863,7 +910,7 @@ export declare type CollectionEdgesOptions = {
|
|
|
863
910
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
864
911
|
* replaced with AQL queries.
|
|
865
912
|
*/
|
|
866
|
-
export
|
|
913
|
+
export type SimpleQueryByExampleOptions = {
|
|
867
914
|
/**
|
|
868
915
|
* Number of documents to skip in the query.
|
|
869
916
|
*/
|
|
@@ -895,7 +942,7 @@ export declare type SimpleQueryByExampleOptions = {
|
|
|
895
942
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
896
943
|
* replaced with AQL queries.
|
|
897
944
|
*/
|
|
898
|
-
export
|
|
945
|
+
export type SimpleQueryAllOptions = {
|
|
899
946
|
/**
|
|
900
947
|
* Number of documents to skip in the query.
|
|
901
948
|
*/
|
|
@@ -933,7 +980,7 @@ export declare type SimpleQueryAllOptions = {
|
|
|
933
980
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
934
981
|
* replaced with AQL queries.
|
|
935
982
|
*/
|
|
936
|
-
export
|
|
983
|
+
export type SimpleQueryUpdateByExampleOptions = {
|
|
937
984
|
/**
|
|
938
985
|
* If set to `false`, properties with a value of `null` will be removed from
|
|
939
986
|
* the new document.
|
|
@@ -967,7 +1014,7 @@ export declare type SimpleQueryUpdateByExampleOptions = {
|
|
|
967
1014
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
968
1015
|
* replaced with AQL queries.
|
|
969
1016
|
*/
|
|
970
|
-
export
|
|
1017
|
+
export type SimpleQueryRemoveByExampleOptions = {
|
|
971
1018
|
/**
|
|
972
1019
|
* If set to `true`, the request will wait until all modifications have been
|
|
973
1020
|
* synchronized to disk before returning successfully.
|
|
@@ -986,14 +1033,14 @@ export declare type SimpleQueryRemoveByExampleOptions = {
|
|
|
986
1033
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
987
1034
|
* replaced with AQL queries.
|
|
988
1035
|
*/
|
|
989
|
-
export
|
|
1036
|
+
export type SimpleQueryReplaceByExampleOptions = SimpleQueryRemoveByExampleOptions;
|
|
990
1037
|
/**
|
|
991
1038
|
* Options for removing documents by keys.
|
|
992
1039
|
*
|
|
993
1040
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
994
1041
|
* replaced with AQL queries.
|
|
995
1042
|
*/
|
|
996
|
-
export
|
|
1043
|
+
export type SimpleQueryRemoveByKeysOptions = {
|
|
997
1044
|
/**
|
|
998
1045
|
* If set to `true`, the complete old document will be returned as the `old`
|
|
999
1046
|
* property on the result object. Has no effect if `silent` is set to `true`.
|
|
@@ -1022,7 +1069,7 @@ export declare type SimpleQueryRemoveByKeysOptions = {
|
|
|
1022
1069
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
1023
1070
|
* replaced with AQL queries.
|
|
1024
1071
|
*/
|
|
1025
|
-
export
|
|
1072
|
+
export type SimpleQueryFulltextOptions = {
|
|
1026
1073
|
/**
|
|
1027
1074
|
* Unique identifier of the fulltext index to use to perform the query.
|
|
1028
1075
|
*/
|
|
@@ -1042,7 +1089,7 @@ export declare type SimpleQueryFulltextOptions = {
|
|
|
1042
1089
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and are
|
|
1043
1090
|
* no longer supported in ArangoDB 3.12. They can be replaced with AQL queries.
|
|
1044
1091
|
*/
|
|
1045
|
-
export
|
|
1092
|
+
export type TraversalOptions = {
|
|
1046
1093
|
/**
|
|
1047
1094
|
* A string evaluating to the body of a JavaScript function to be executed
|
|
1048
1095
|
* on the server to initialize the traversal result object.
|
|
@@ -1183,7 +1230,7 @@ export declare type TraversalOptions = {
|
|
|
1183
1230
|
/**
|
|
1184
1231
|
* Result of a collection bulk import.
|
|
1185
1232
|
*/
|
|
1186
|
-
export
|
|
1233
|
+
export type CollectionImportResult = {
|
|
1187
1234
|
/**
|
|
1188
1235
|
* Whether the import failed.
|
|
1189
1236
|
*/
|
|
@@ -1216,7 +1263,7 @@ export declare type CollectionImportResult = {
|
|
|
1216
1263
|
/**
|
|
1217
1264
|
* Result of retrieving edges in a collection.
|
|
1218
1265
|
*/
|
|
1219
|
-
export
|
|
1266
|
+
export type CollectionEdgesResult<T extends Record<string, any> = any> = {
|
|
1220
1267
|
edges: Edge<T>[];
|
|
1221
1268
|
stats: {
|
|
1222
1269
|
scannedIndex: number;
|
|
@@ -1231,7 +1278,7 @@ export declare type CollectionEdgesResult<T extends Record<string, any> = any> =
|
|
|
1231
1278
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
1232
1279
|
* replaced with AQL queries.
|
|
1233
1280
|
*/
|
|
1234
|
-
export
|
|
1281
|
+
export type SimpleQueryRemoveByExampleResult = {
|
|
1235
1282
|
/**
|
|
1236
1283
|
* Number of documents removed.
|
|
1237
1284
|
*/
|
|
@@ -1245,7 +1292,7 @@ export declare type SimpleQueryRemoveByExampleResult = {
|
|
|
1245
1292
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
1246
1293
|
* replaced with AQL queries.
|
|
1247
1294
|
*/
|
|
1248
|
-
export
|
|
1295
|
+
export type SimpleQueryReplaceByExampleResult = {
|
|
1249
1296
|
/**
|
|
1250
1297
|
* Number of documents replaced.
|
|
1251
1298
|
*/
|
|
@@ -1259,7 +1306,7 @@ export declare type SimpleQueryReplaceByExampleResult = {
|
|
|
1259
1306
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
1260
1307
|
* replaced with AQL queries.
|
|
1261
1308
|
*/
|
|
1262
|
-
export
|
|
1309
|
+
export type SimpleQueryUpdateByExampleResult = {
|
|
1263
1310
|
/**
|
|
1264
1311
|
* Number of documents updated.
|
|
1265
1312
|
*/
|
|
@@ -1273,7 +1320,7 @@ export declare type SimpleQueryUpdateByExampleResult = {
|
|
|
1273
1320
|
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
|
|
1274
1321
|
* replaced with AQL queries.
|
|
1275
1322
|
*/
|
|
1276
|
-
export
|
|
1323
|
+
export type SimpleQueryRemoveByKeysResult<T extends Record<string, any> = any> = {
|
|
1277
1324
|
/**
|
|
1278
1325
|
* Number of documents removed.
|
|
1279
1326
|
*/
|
|
@@ -1724,8 +1771,9 @@ export interface DocumentCollection<T extends Record<string, any> = any> extends
|
|
|
1724
1771
|
* console.log(result.new.color, result.new.count); // "blue" 1
|
|
1725
1772
|
* ```
|
|
1726
1773
|
*/
|
|
1727
|
-
save(data: DocumentData<T>, options?: CollectionInsertOptions): Promise<
|
|
1774
|
+
save(data: DocumentData<T>, options?: CollectionInsertOptions): Promise<DocumentOperationMetadata & {
|
|
1728
1775
|
new?: Document<T>;
|
|
1776
|
+
old?: Document<T>;
|
|
1729
1777
|
}>;
|
|
1730
1778
|
/**
|
|
1731
1779
|
* Inserts new documents with the given `data` into the collection.
|
|
@@ -1748,9 +1796,10 @@ export interface DocumentCollection<T extends Record<string, any> = any> extends
|
|
|
1748
1796
|
* console.log(result[1].new.color, result[1].new.count); // "red" 2
|
|
1749
1797
|
* ```
|
|
1750
1798
|
*/
|
|
1751
|
-
saveAll(data: Array<DocumentData<T>>, options?: CollectionInsertOptions): Promise<Array<
|
|
1799
|
+
saveAll(data: Array<DocumentData<T>>, options?: CollectionInsertOptions): Promise<Array<(DocumentOperationMetadata & {
|
|
1752
1800
|
new?: Document<T>;
|
|
1753
|
-
|
|
1801
|
+
old?: Document<T>;
|
|
1802
|
+
}) | DocumentOperationFailure>>;
|
|
1754
1803
|
/**
|
|
1755
1804
|
* Replaces an existing document in the collection.
|
|
1756
1805
|
*
|
|
@@ -1775,7 +1824,7 @@ export interface DocumentCollection<T extends Record<string, any> = any> extends
|
|
|
1775
1824
|
* console.log(result.new.color, result.new.count); // "red" undefined
|
|
1776
1825
|
* ```
|
|
1777
1826
|
*/
|
|
1778
|
-
replace(selector: DocumentSelector, newData: DocumentData<T>, options?: CollectionReplaceOptions): Promise<
|
|
1827
|
+
replace(selector: DocumentSelector, newData: DocumentData<T>, options?: CollectionReplaceOptions): Promise<DocumentOperationMetadata & {
|
|
1779
1828
|
new?: Document<T>;
|
|
1780
1829
|
old?: Document<T>;
|
|
1781
1830
|
}>;
|
|
@@ -1807,10 +1856,10 @@ export interface DocumentCollection<T extends Record<string, any> = any> extends
|
|
|
1807
1856
|
_key: string;
|
|
1808
1857
|
} | {
|
|
1809
1858
|
_id: string;
|
|
1810
|
-
})>, options?: Omit<CollectionReplaceOptions, "ifMatch">): Promise<Array<
|
|
1859
|
+
})>, options?: Omit<CollectionReplaceOptions, "ifMatch">): Promise<Array<(DocumentOperationMetadata & {
|
|
1811
1860
|
new?: Document<T>;
|
|
1812
1861
|
old?: Document<T>;
|
|
1813
|
-
}>>;
|
|
1862
|
+
}) | DocumentOperationFailure>>;
|
|
1814
1863
|
/**
|
|
1815
1864
|
* Updates an existing document in the collection.
|
|
1816
1865
|
*
|
|
@@ -1835,7 +1884,7 @@ export interface DocumentCollection<T extends Record<string, any> = any> extends
|
|
|
1835
1884
|
* console.log(result.new.color, result.new.count); // "blue" 2
|
|
1836
1885
|
* ```
|
|
1837
1886
|
*/
|
|
1838
|
-
update(selector: DocumentSelector, newData: Patch<DocumentData<T>>, options?: CollectionUpdateOptions): Promise<
|
|
1887
|
+
update(selector: DocumentSelector, newData: Patch<DocumentData<T>>, options?: CollectionUpdateOptions): Promise<DocumentOperationMetadata & {
|
|
1839
1888
|
new?: Document<T>;
|
|
1840
1889
|
old?: Document<T>;
|
|
1841
1890
|
}>;
|
|
@@ -1867,10 +1916,10 @@ export interface DocumentCollection<T extends Record<string, any> = any> extends
|
|
|
1867
1916
|
_key: string;
|
|
1868
1917
|
} | {
|
|
1869
1918
|
_id: string;
|
|
1870
|
-
})>, options?: Omit<CollectionUpdateOptions, "ifMatch">): Promise<Array<
|
|
1919
|
+
})>, options?: Omit<CollectionUpdateOptions, "ifMatch">): Promise<Array<(DocumentOperationMetadata & {
|
|
1871
1920
|
new?: Document<T>;
|
|
1872
1921
|
old?: Document<T>;
|
|
1873
|
-
}>>;
|
|
1922
|
+
}) | DocumentOperationFailure>>;
|
|
1874
1923
|
/**
|
|
1875
1924
|
* Removes an existing document from the collection.
|
|
1876
1925
|
*
|
|
@@ -1919,9 +1968,9 @@ export interface DocumentCollection<T extends Record<string, any> = any> extends
|
|
|
1919
1968
|
* // document with keys "abc123" and "def456" deleted
|
|
1920
1969
|
* ```
|
|
1921
1970
|
*/
|
|
1922
|
-
removeAll(selectors: (string | ObjectWithKey)[], options?: Omit<CollectionRemoveOptions, "ifMatch">): Promise<Array<DocumentMetadata & {
|
|
1971
|
+
removeAll(selectors: (string | ObjectWithKey)[], options?: Omit<CollectionRemoveOptions, "ifMatch">): Promise<Array<(DocumentMetadata & {
|
|
1923
1972
|
old?: Document<T>;
|
|
1924
|
-
}>>;
|
|
1973
|
+
}) | DocumentOperationFailure>>;
|
|
1925
1974
|
/**
|
|
1926
1975
|
* Bulk imports the given `data` into the collection.
|
|
1927
1976
|
*
|
|
@@ -2402,14 +2451,14 @@ export interface DocumentCollection<T extends Record<string, any> = any> extends
|
|
|
2402
2451
|
* const collection = db.collection("some-points");
|
|
2403
2452
|
* // Create a multi-dimensional index for the attributes x, y and z
|
|
2404
2453
|
* await collection.ensureIndex({
|
|
2405
|
-
* type: "
|
|
2454
|
+
* type: "mdi",
|
|
2406
2455
|
* fields: ["x", "y", "z"],
|
|
2407
2456
|
* fieldValueTypes: "double"
|
|
2408
2457
|
* });
|
|
2409
2458
|
* ```
|
|
2410
2459
|
* ```
|
|
2411
2460
|
*/
|
|
2412
|
-
ensureIndex(details:
|
|
2461
|
+
ensureIndex(details: EnsureMdiIndexOptions): Promise<ArangoApiResponse<MdiIndex & {
|
|
2413
2462
|
isNewlyCreated: boolean;
|
|
2414
2463
|
}>>;
|
|
2415
2464
|
/**
|
|
@@ -2638,8 +2687,9 @@ export interface EdgeCollection<T extends Record<string, any> = any> extends Doc
|
|
|
2638
2687
|
* );
|
|
2639
2688
|
* ```
|
|
2640
2689
|
*/
|
|
2641
|
-
save(data: EdgeData<T>, options?: CollectionInsertOptions): Promise<
|
|
2690
|
+
save(data: EdgeData<T>, options?: CollectionInsertOptions): Promise<DocumentOperationMetadata & {
|
|
2642
2691
|
new?: Edge<T>;
|
|
2692
|
+
old?: Edge<T>;
|
|
2643
2693
|
}>;
|
|
2644
2694
|
/**
|
|
2645
2695
|
* Inserts new documents with the given `data` into the collection.
|
|
@@ -2660,9 +2710,10 @@ export interface EdgeCollection<T extends Record<string, any> = any> extends Doc
|
|
|
2660
2710
|
* );
|
|
2661
2711
|
* ```
|
|
2662
2712
|
*/
|
|
2663
|
-
saveAll(data: Array<EdgeData<T>>, options?: CollectionInsertOptions): Promise<Array<
|
|
2713
|
+
saveAll(data: Array<EdgeData<T>>, options?: CollectionInsertOptions): Promise<Array<(DocumentOperationMetadata & {
|
|
2664
2714
|
new?: Edge<T>;
|
|
2665
|
-
|
|
2715
|
+
old?: Edge<T>;
|
|
2716
|
+
}) | DocumentOperationFailure>>;
|
|
2666
2717
|
/**
|
|
2667
2718
|
* Replaces an existing document in the collection.
|
|
2668
2719
|
*
|
|
@@ -2695,7 +2746,7 @@ export interface EdgeCollection<T extends Record<string, any> = any> extends Doc
|
|
|
2695
2746
|
* console.log(result.new.active, result.new.best); // false undefined
|
|
2696
2747
|
* ```
|
|
2697
2748
|
*/
|
|
2698
|
-
replace(selector: DocumentSelector, newData: DocumentData<T>, options?: CollectionReplaceOptions): Promise<
|
|
2749
|
+
replace(selector: DocumentSelector, newData: DocumentData<T>, options?: CollectionReplaceOptions): Promise<DocumentOperationMetadata & {
|
|
2699
2750
|
new?: Edge<T>;
|
|
2700
2751
|
old?: Edge<T>;
|
|
2701
2752
|
}>;
|
|
@@ -2743,10 +2794,10 @@ export interface EdgeCollection<T extends Record<string, any> = any> extends Doc
|
|
|
2743
2794
|
_key: string;
|
|
2744
2795
|
} | {
|
|
2745
2796
|
_id: string;
|
|
2746
|
-
})>, options?: CollectionReplaceOptions): Promise<Array<
|
|
2797
|
+
})>, options?: CollectionReplaceOptions): Promise<Array<(DocumentOperationMetadata & {
|
|
2747
2798
|
new?: Edge<T>;
|
|
2748
2799
|
old?: Edge<T>;
|
|
2749
|
-
}>>;
|
|
2800
|
+
}) | DocumentOperationFailure>>;
|
|
2750
2801
|
/**
|
|
2751
2802
|
* Updates an existing document in the collection.
|
|
2752
2803
|
*
|
|
@@ -2779,7 +2830,7 @@ export interface EdgeCollection<T extends Record<string, any> = any> extends Doc
|
|
|
2779
2830
|
* console.log(result.new.active, result.new.best); // false true
|
|
2780
2831
|
* ```
|
|
2781
2832
|
*/
|
|
2782
|
-
update(selector: DocumentSelector, newData: Patch<DocumentData<T>>, options?: CollectionUpdateOptions): Promise<
|
|
2833
|
+
update(selector: DocumentSelector, newData: Patch<DocumentData<T>>, options?: CollectionUpdateOptions): Promise<DocumentOperationMetadata & {
|
|
2783
2834
|
new?: Edge<T>;
|
|
2784
2835
|
old?: Edge<T>;
|
|
2785
2836
|
}>;
|
|
@@ -2825,10 +2876,10 @@ export interface EdgeCollection<T extends Record<string, any> = any> extends Doc
|
|
|
2825
2876
|
_key: string;
|
|
2826
2877
|
} | {
|
|
2827
2878
|
_id: string;
|
|
2828
|
-
})>, options?: CollectionUpdateOptions): Promise<Array<
|
|
2879
|
+
})>, options?: CollectionUpdateOptions): Promise<Array<(DocumentOperationMetadata & {
|
|
2829
2880
|
new?: Edge<T>;
|
|
2830
2881
|
old?: Edge<T>;
|
|
2831
|
-
}>>;
|
|
2882
|
+
}) | DocumentOperationFailure>>;
|
|
2832
2883
|
/**
|
|
2833
2884
|
* Removes an existing document from the collection.
|
|
2834
2885
|
*
|
|
@@ -2869,9 +2920,9 @@ export interface EdgeCollection<T extends Record<string, any> = any> extends Doc
|
|
|
2869
2920
|
* // document with keys "musadir" and "salman" deleted
|
|
2870
2921
|
* ```
|
|
2871
2922
|
*/
|
|
2872
|
-
removeAll(selectors: DocumentSelector[], options?: CollectionRemoveOptions): Promise<Array<DocumentMetadata & {
|
|
2923
|
+
removeAll(selectors: DocumentSelector[], options?: CollectionRemoveOptions): Promise<Array<(DocumentMetadata & {
|
|
2873
2924
|
old?: Edge<T>;
|
|
2874
|
-
}>>;
|
|
2925
|
+
}) | DocumentOperationFailure>>;
|
|
2875
2926
|
/**
|
|
2876
2927
|
* Bulk imports the given `data` into the collection.
|
|
2877
2928
|
*
|
|
@@ -3293,7 +3344,7 @@ export declare class Collection<T extends Record<string, any> = any> implements
|
|
|
3293
3344
|
removeByKeys(keys: string[], options?: SimpleQueryRemoveByKeysOptions): Promise<any>;
|
|
3294
3345
|
indexes(): Promise<any>;
|
|
3295
3346
|
index(selector: IndexSelector): Promise<any>;
|
|
3296
|
-
ensureIndex(options: EnsurePersistentIndexOptions | EnsureGeoIndexOptions | EnsureFulltextIndexOptions | EnsureTtlIndexOptions |
|
|
3347
|
+
ensureIndex(options: EnsurePersistentIndexOptions | EnsureGeoIndexOptions | EnsureFulltextIndexOptions | EnsureTtlIndexOptions | EnsureMdiIndexOptions | EnsureInvertedIndexOptions): Promise<any>;
|
|
3297
3348
|
dropIndex(selector: IndexSelector): Promise<any>;
|
|
3298
3349
|
fulltext(attribute: string, query: string, { index, ...options }?: SimpleQueryFulltextOptions): Promise<ArrayCursor<any>>;
|
|
3299
3350
|
compact(): Promise<any>;
|