forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollection.d.ts
More file actions
3124 lines (3124 loc) · 102 KB
/
Copy pathcollection.d.ts
File metadata and controls
3124 lines (3124 loc) · 102 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// <reference types="node" />
/**
* ```ts
* import type {
* DocumentCollection,
* EdgeCollection,
* } from "arangojs/collection";
* ```
*
* The "collection" module provides collection related types and interfaces
* for TypeScript.
*
* @packageDocumentation
*/
import { ArangoResponseMetadata, Dict } from "./connection";
import { ArrayCursor } from "./cursor";
import { Database } from "./database";
import { Document, DocumentData, DocumentMetadata, DocumentSelector, Edge, EdgeData, Patch } from "./documents";
import { EnsureFulltextIndexOptions, EnsureGeoIndexOptions, EnsureHashIndexOptions, EnsurePersistentIndexOptions, EnsureSkiplistIndexOptions, EnsureTtlIndexOptions, FulltextIndex, GeoIndex, HashIndex, Index, IndexSelector, PersistentIndex, SkiplistIndex, TtlIndex } from "./indexes";
import { Blob } from "./lib/blob";
/**
* Indicates whether the given value represents an {@link ArangoCollection}.
*
* @param collection - A value that might be a collection.
*/
export declare function isArangoCollection(collection: any): collection is ArangoCollection;
/**
* Coerces the given collection name or {@link ArangoCollection} object to
* a string representing the collection name.
*
* @param collection - Collection name or {@link ArangoCollection} object.
*/
export declare function collectionToString(collection: string | ArangoCollection): string;
/**
* A marker interface identifying objects that can be used in AQL template
* strings to create references to ArangoDB collections.
*
* See {@link aql}.
*/
export interface ArangoCollection {
/**
* @internal
*
* Indicates that this object represents an ArangoDB collection.
*/
readonly isArangoCollection: true;
/**
* Name of the collection.
*/
readonly name: string;
}
/**
* Integer values indicating the collection type.
*/
export declare enum CollectionType {
DOCUMENT_COLLECTION = 2,
EDGE_COLLECTION = 3
}
/**
* Integer values indicating the collection loading status.
*/
export declare enum CollectionStatus {
NEWBORN = 1,
UNLOADED = 2,
LOADED = 3,
UNLOADING = 4,
DELETED = 5,
LOADING = 6
}
/**
* Type of key generator.
*/
export declare type KeyGenerator = "traditional" | "autoincrement" | "uuid" | "padded";
/**
* Strategy for sharding a collection.
*/
export declare type ShardingStrategy = "hash" | "enterprise-hash-smart-edge" | "community-compat" | "enterprise-compat" | "enterprise-smart-edge-compat";
/**
* Type of document reference.
*
* See {@link DocumentCollection.list} and {@link EdgeCollection.list}.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type SimpleQueryListType = "id" | "key" | "path";
/**
* When a validation should be applied.
*
* * `"none"`: No validation.
* * `"new"`: Newly inserted documents are validated.
* * `"moderate"`: New and modified documents are validated unless the modified
* document was already invalid.
* * `"strict"`: New and modified documents are always validated.
*/
export declare type ValidationLevel = "none" | "new" | "moderate" | "strict";
/**
* General information about a collection.
*/
export declare type CollectionMetadata = {
/**
* Collection name.
*/
name: string;
/**
* A globally unique identifier for this collection.
*/
globallyUniqueId: string;
/**
* An integer indicating the collection loading status.
*/
status: CollectionStatus;
/**
* An integer indicating the collection type.
*/
type: CollectionType;
/**
* @internal
*
* Whether the collection is a system collection.
*/
isSystem: boolean;
};
/**
* An object defining the collection's key generation.
*/
export declare type CollectionKeyProperties = {
/**
* Type of key generator to use.
*/
type: KeyGenerator;
/**
* Whether documents can be created with a user-specified `_key` attribute.
*/
allowUserKeys: boolean;
/**
* (Autoincrement only.) How many steps to increment the key each time.
*/
increment?: number;
/**
* (Autoincrement only.) Initial offset for the key.
*/
offset?: number;
/**
* Most recent key that has been generated.
*/
lastValue: number;
};
/**
* Properties for validating documents in a collection.
*/
export declare type SchemaProperties = {
/**
* Type of document validation.
*/
type: "json";
/**
* JSON Schema description of the validation schema for documents.
*/
rule: any;
/**
* When validation should be applied.
*/
level: ValidationLevel;
/**
* Message to be used if validation fails.
*/
message: string;
};
/**
* An object defining the properties of a collection.
*/
export declare type CollectionProperties = {
/**
* A human-readable representation of the collection loading status.
*/
statusString: string;
/**
* Whether data should be synchronized to disk before returning from
* a document create, update, replace or removal operation.
*/
waitForSync: boolean;
/**
* An object defining the collection's key generation.
*/
keyOptions: CollectionKeyProperties;
/**
* Properties for validating documents in the collection.
*/
schema: SchemaProperties | null;
/**
* (Cluster only.) Write concern for this collection.
*/
writeConcern: number;
/**
* (Cluster only.) Write concern for this collection.
*
* @deprecated Renamed to `writeConcern` in ArangoDB 3.6.
*/
minReplicationFactor?: number;
/**
* (Cluster only.) Number of shards of this collection.
*/
numberOfShards?: number;
/**
* (Cluster only.) Keys of this collection that will be used for
* sharding.
*/
shardKeys?: string[];
/**
* (Cluster only.) Replication factor of the collection.
*/
replicationFactor?: number;
/**
* (Cluster only.) Sharding strategy of the collection.
*/
shardingStrategy?: ShardingStrategy;
/**
* (MMFiles only.) Whether the collection will be compacted.
*/
doCompact?: boolean;
/**
* (MMFiles only.) Maximum size for each journal or datafile in bytes.
*/
journalSize?: number;
/**
* (MMFiles only.) Number of buckets into which indexes using hash tables are
* split.
*/
indexBuckets?: number;
/**
* (MMFiles only.) If set to `true`, the collection will only be kept
* in-memory and discarded when unloaded, resulting in full data loss.
*/
isVolatile?: boolean;
/**
* (Enterprise Edition cluster only.) If set to a collection name, sharding
* of the new collection will follow the rules for that collection. As long
* as the new collection exists, the indicated collection can not be dropped.
*/
distributeShardsLike?: string;
/**
* (Enterprise Edition cluster only.) Attribute containing the shard key
* value of the referred-to smart join collection.
*/
smartJoinAttribute?: string;
};
/**
* Options for validating collection documents.
*/
export declare type SchemaOptions = {
/**
* JSON Schema description of the validation schema for documents.
*/
rule: any;
/**
* When validation should be applied.
*
* Default: `"strict"`
*/
level?: ValidationLevel;
/**
* Message to be used if validation fails.
*/
message?: string;
};
/**
* Options for setting a collection's properties.
*
* See {@link DocumentCollection.properties} and {@link EdgeCollection.properties}.
*/
export declare type CollectionPropertiesOptions = {
/**
* Whether data should be synchronized to disk before returning from
* a document create, update, replace or removal operation.
*/
waitForSync?: boolean;
/**
* Options for validating documents in this collection.
*/
schema?: SchemaOptions;
/**
* (MMFiles only.) Maximum size for each journal or datafile in bytes.
*
* Must be a number greater than or equal to `1048576` (1 MiB).
*/
journalSize?: number;
};
/**
* Options for retrieving a collection checksum.
*/
export declare type CollectionChecksumOptions = {
/**
* If set to `true`, revision IDs will be included in the calculation
* of the checksum.
*
* Default: `false`
*/
withRevisions?: boolean;
/**
* If set to `true`, document data will be included in the calculation
* of the checksum.
*
* Default: `false`
*/
withData?: boolean;
};
/**
* Options for dropping collections.
*/
export declare type CollectionDropOptions = {
/**
* Whether the collection is a system collection. If the collection is a
* system collection, this option must be set to `true` or ArangoDB will
* refuse to drop the collection.
*
* Default: `false`
*/
isSystem?: boolean;
};
/**
* An object defining the collection's key generation.
*/
export declare type CollectionKeyOptions = {
/**
* Type of key generator to use.
*/
type?: KeyGenerator;
/**
* Unless set to `false`, documents can be created with a user-specified
* `_key` attribute.
*
* Default: `true`
*/
allowUserKeys?: boolean;
/**
* (Autoincrement only.) How many steps to increment the key each time.
*/
increment?: number;
/**
* (Autoincrement only.) Initial offset for the key.
*/
offset?: number;
};
/**
* Options for creating a collection.
*
* See {@link Database.createCollection}, {@link Database.createEdgeCollection}
* and {@link DocumentCollection.create} or {@link EdgeCollection.create}.
*/
export declare type CreateCollectionOptions = {
/**
* If set to `true`, data will be synchronized to disk before returning from
* a document create, update, replace or removal operation.
*
* Default: `false`
*/
waitForSync?: boolean;
/**
* @internal
*
* Whether the collection should be created as a system collection.
*
* Default: `false`
*/
isSystem?: boolean;
/**
* An object defining the collection's key generation.
*/
keyOptions?: CollectionKeyOptions;
/**
* Options for validating documents in the collection.
*/
schema?: SchemaOptions;
/**
* (Cluster only.) Unless set to `false`, the server will wait for all
* replicas to create the collection before returning.
*
* Default: `true`
*/
waitForSyncReplication?: boolean;
/**
* (Cluster only.) Unless set to `false`, the server will check whether
* enough replicas are available at creation time and bail out otherwise.
*
* Default: `true`
*/
enforceReplicationFactor?: boolean;
/**
* (Cluster only.) Number of shards to distribute the collection across.
*
* Default: `1`
*/
numberOfShards?: number;
/**
* (Cluster only.) Document attributes to use to determine the target shard
* for each document.
*
* Default: `["_key"]`
*/
shardKeys?: string[];
/**
* (Cluster only.) How many copies of each document should be kept in the
* cluster.
*
* Default: `1`
*/
replicationFactor?: number;
/**
* (Cluster only.) Write concern for this collection.
*/
writeConcern?: number;
/**
* (Cluster only.) Write concern for this collection.
*
* @deprecated Renamed to `writeConcern` in ArangoDB 3.6.
*/
minReplicationFactor?: number;
/**
* (Cluster only.) Sharding strategy to use.
*/
shardingStrategy?: ShardingStrategy;
/**
* (MMFiles only.) Number of buckets into which indexes using hash tables are
* split.
*
* Must be a power of 2 and less than or equal to `1024`.
*
* Default: `16`
*/
indexBuckets?: number;
/**
* (MMFiles only.) Whether the collection will be compacted.
*
* Default: `true`
*/
doCompact?: boolean;
/**
* (MMFiles only.) Maximum size for each journal or datafile in bytes.
*
* Must be a number greater than or equal to `1048576` (1 MiB).
*/
journalSize?: number;
/**
* (MMFiles only.) If set to `true`, the collection will only be kept
* in-memory and discarded when unloaded, resulting in full data loss.
*
* Default: `false`
*/
isVolatile?: boolean;
/**
* (Enterprise Edition cluster only.) If set to a collection name, sharding
* of the new collection will follow the rules for that collection. As long
* as the new collection exists, the indicated collection can not be dropped.
*/
distributeShardsLike?: string;
/**
* (Enterprise Edition cluster only.) Attribute containing the shard key
* value of the referred-to smart join collection.
*/
smartJoinAttribute?: string;
};
/**
* Options for retrieving a document from a collection.
*/
export declare type CollectionReadOptions = {
/**
* If set to `true`, `null` is returned instead of an exception being thrown
* if the document does not exist.
*/
graceful?: boolean;
/**
* If set to `true`, the request will explicitly permit ArangoDB to return a
* potentially dirty or stale result and arangojs will load balance the
* request without distinguishing between leaders and followers.
*/
allowDirtyRead?: boolean;
};
/**
* Options for inserting a new document into a collection.
*/
export declare type CollectionInsertOptions = {
/**
* If set to `true`, data will be synchronized to disk before returning.
*
* Default: `false`
*/
waitForSync?: boolean;
/**
* If set to `true`, no data will be returned by the server. This option can
* be used to reduce network traffic.
*
* Default: `false`
*/
silent?: boolean;
/**
* If set to `true`, the complete new document will be returned as the `new`
* property on the result object. Has no effect if `silent` is set to `true`.
*
* Default: `false`
*/
returnNew?: boolean;
/**
* If set to `true`, a document with the same `_key` or `_id` already
* existing will be overwritten instead of resulting in an exception.
*
* @deprecated This option has been deprecated in ArangoDB 3.7 and replaced
* with the `overwriteMode` option.
*/
overwrite?: boolean;
/**
* Defines what should happen if a document with the same `_key` or `_id`
* already exists, instead of throwing an exception.
*
* Default: `"conflict"
*/
overwriteMode?: "ignore" | "update" | "replace" | "conflict";
};
/**
* Options for replacing an existing document in a collection.
*/
export declare type CollectionReplaceOptions = {
/**
* If set to `true`, data will be synchronized to disk before returning.
*
* Default: `false`
*/
waitForSync?: boolean;
/**
* If set to `true`, no data will be returned by the server. This option can
* be used to reduce network traffic.
*
* Default: `false`
*/
silent?: boolean;
/**
* If set to `true`, the complete new document will be returned as the `new`
* property on the result object. Has no effect if `silent` is set to `true`.
*
* Default: `false`
*/
returnNew?: boolean;
/**
* If set to `false`, the existing document will only be modified if its
* `_rev` property matches the same property on the new data.
*
* Default: `true`
*/
ignoreRevs?: boolean;
/**
* If set to `true`, the complete old document will be returned as the `old`
* property on the result object. Has no effect if `silent` is set to `true`.
*
* Default: `false`
*/
returnOld?: boolean;
};
/**
* Options for updating a document in a collection.
*/
export declare type CollectionUpdateOptions = {
/**
* If set to `true`, data will be synchronized to disk before returning.
*
* Default: `false`
*/
waitForSync?: boolean;
/**
* If set to `true`, no data will be returned by the server. This option can
* be used to reduce network traffic.
*
* Default: `false`
*/
silent?: boolean;
/**
* If set to `true`, the complete new document will be returned as the `new`
* property on the result object. Has no effect if `silent` is set to `true`.
*
* Default: `false`
*/
returnNew?: boolean;
/**
* If set to `false`, the existing document will only be modified if its
* `_rev` property matches the same property on the new data.
*
* Default: `true`
*/
ignoreRevs?: boolean;
/**
* If set to `true`, the complete old document will be returned as the `old`
* property on the result object. Has no effect if `silent` is set to `true`.
*
* Default: `false`
*/
returnOld?: boolean;
/**
* If set to `false`, properties with a value of `null` will be removed from
* the new document.
*
* Default: `true`
*/
keepNull?: boolean;
/**
* If set to `false`, object properties that already exist in the old
* document will be overwritten rather than merged. This does not affect
* arrays.
*
* Default: `true`
*/
mergeObjects?: boolean;
};
/**
* Options for removing a document from a collection.
*/
export declare type CollectionRemoveOptions = {
/**
* If set to `true`, changes will be synchronized to disk before returning.
*
* Default: `false`
*/
waitForSync?: boolean;
/**
* If set to `true`, the complete old document will be returned as the `old`
* property on the result object. Has no effect if `silent` is set to `true`.
*
* Default: `false`
*/
returnOld?: boolean;
/**
* If set to `true`, no data will be returned by the server. This option can
* be used to reduce network traffic.
*
* Default: `false`
*/
silent?: boolean;
};
/**
* Options for bulk importing documents into a collection.
*/
export declare type CollectionImportOptions = {
/**
* (Edge collections only.) Prefix to prepend to `_from` attribute values.
*/
fromPrefix?: string;
/**
* (Edge collections only.) Prefix to prepend to `_to` attribute values.
*/
toPrefix?: string;
/**
* If set to `true`, the collection is truncated before the data is imported.
*
* Default: `false`
*/
overwrite?: boolean;
/**
* Whether to wait for the documents to have been synced to disk.
*/
waitForSync?: boolean;
/**
* Controls behavior when a unique constraint is violated on the document key.
*
* * `"error"`: the document will not be imported.
* * `"update`: the document will be merged into the existing document.
* * `"replace"`: the document will replace the existing document.
* * `"ignore"`: the document will not be imported and the unique constraint
* error will be ignored.
*
* Default: `"error"`
*/
onDuplicate?: "error" | "update" | "replace" | "ignore";
/**
* If set to `true`, the import will abort if any error occurs.
*/
complete?: boolean;
/**
* Whether the response should contain additional details about documents
* that could not be imported.
*/
details?: boolean;
};
/**
* Options for retrieving documents by example.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type SimpleQueryByExampleOptions = {
/**
* Number of documents to skip in the query.
*/
skip?: number;
/**
* Maximum number of documents to return.
*/
limit?: number;
/**
* Number of result values to be transferred by the server in each
* network roundtrip (or "batch").
*
* Must be greater than zero.
*
* See also {@link QueryOptions}.
*/
batchSize?: number;
/**
* Time-to-live for the cursor in seconds. The cursor results may be
* garbage collected by ArangoDB after this much time has passed.
*
* See also {@link QueryOptions}.
*/
ttl?: number;
};
/**
* Options for retrieving all documents in a collection.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type SimpleQueryAllOptions = {
/**
* Number of documents to skip in the query.
*/
skip?: number;
/**
* Maximum number of documents to return.
*/
limit?: number;
/**
* Number of result values to be transferred by the server in each
* network roundtrip (or "batch").
*
* Must be greater than zero.
*
* See also {@link QueryOptions}.
*/
batchSize?: number;
/**
* Time-to-live for the cursor in seconds. The cursor results may be
* garbage collected by ArangoDB after this much time has passed.
*
* See also {@link QueryOptions}.
*/
ttl?: number;
/**
* If set to `true`, the query will be executed as a streaming query.
*
* See also {@link QueryOptions}.
*/
stream?: boolean;
};
/**
* Options for updating documents by example.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type SimpleQueryUpdateByExampleOptions = {
/**
* If set to `false`, properties with a value of `null` will be removed from
* the new document.
*
* Default: `true`
*/
keepNull?: boolean;
/**
* If set to `true`, the request will wait until all modifications have been
* synchronized to disk before returning successfully.
*
* Default: `false`
*/
waitForSync?: boolean;
/**
* Maximum number of documents to return.
*/
limit?: number;
/**
* If set to `false`, object properties that already exist in the old
* document will be overwritten rather than merged. This does not affect
* arrays.
*
* Default: `true`
*/
mergeObjects?: boolean;
};
/**
* Options for removing documents by example.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type SimpleQueryRemoveByExampleOptions = {
/**
* If set to `true`, the request will wait until all modifications have been
* synchronized to disk before returning successfully.
*
* Default: `false`
*/
waitForSync?: boolean;
/**
* Maximum number of documents to return.
*/
limit?: number;
};
/**
* Options for replacing documents by example.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type SimpleQueryReplaceByExampleOptions = SimpleQueryRemoveByExampleOptions;
/**
* Options for removing documents by keys.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type SimpleQueryRemoveByKeysOptions = {
/**
* If set to `true`, the complete old document will be returned as the `old`
* property on the result object. Has no effect if `silent` is set to `true`.
*
* Default: `false`
*/
returnOld?: boolean;
/**
* If set to `true`, no data will be returned by the server. This option can
* be used to reduce network traffic.
*
* Default: `false`
*/
silent?: boolean;
/**
* If set to `true`, the request will wait until all modifications have been
* synchronized to disk before returning successfully.
*
* Default: `false`
*/
waitForSync?: boolean;
};
/**
* Options for performing a fulltext query.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type SimpleQueryFulltextOptions = {
/**
* Unique identifier of the fulltext index to use to perform the query.
*/
index?: string;
/**
* Maximum number of documents to return.
*/
limit?: number;
/**
* Number of documents to skip in the query.
*/
skip?: number;
};
/**
* Options for performing a graph traversal.
*
* @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be
* replaced with AQL queries.
*/
export declare type TraversalOptions = {
/**
* A string evaluating to the body of a JavaScript function to be executed
* on the server to initialize the traversal result object.
*
* The code has access to two variables: `config`, `result`.
* The code may modify the `result` object.
*
* **Note**: This code will be evaluated and executed on the
* server inside ArangoDB's embedded JavaScript environment and can not
* access any other variables.
*
* See the official ArangoDB documentation for
* {@link https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html | the JavaScript `@arangodb` module}
* for information about accessing the database from within ArangoDB's
* server-side JavaScript environment.
*/
init?: string;
/**
* A string evaluating to the body of a JavaScript function to be executed
* on the server to filter nodes.
*
* The code has access to three variables: `config`, `vertex`, `path`.
* The code may include a return statement for the following values:
*
* * `"exclude"`: The vertex will not be visited.
* * `"prune"`: The edges of the vertex will not be followed.
* * `""` or `undefined`: The vertex will be visited and its edges followed.
* * an array including any of the above values.
*
* **Note**: This code will be evaluated and executed on the
* server inside ArangoDB's embedded JavaScript environment and can not
* access any other variables.
*
* See the official ArangoDB documentation for
* {@link https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html | the JavaScript `@arangodb` module}
* for information about accessing the database from within ArangoDB's
* server-side JavaScript environment.
*/
filter?: string;
/**
* A string evaluating to the body of a JavaScript function to be executed
* on the server to sort edges if `expander` is not set.
*
* The code has access to two variables representing edges: `l`, `r`.
* The code must return `-1` if `l < r`, `1` if `l > r` or `0` if both
* values are equal.
*
* **Note**: This code will be evaluated and executed on the
* server inside ArangoDB's embedded JavaScript environment and can not
* access any other variables.
*
* See the official ArangoDB documentation for
* {@link https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html | the JavaScript `@arangodb` module}
* for information about accessing the database from within ArangoDB's
* server-side JavaScript environment.
*/
sort?: string;
/**
* A string evaluating to the body of a JavaScript function to be executed
* on the server when a node is visited.
*
* The code has access to five variables: `config`, `result`, `vertex`,
* `path`, `connected`.
* The code may modify the `result` object.
*
* **Note**: This code will be evaluated and executed on the
* server inside ArangoDB's embedded JavaScript environment and can not
* access any other variables.
*
* See the official ArangoDB documentation for
* {@link https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html | the JavaScript `@arangodb` module}
* for information about accessing the database from within ArangoDB's
* server-side JavaScript environment.
*/
visitor?: string;
/**
* A string evaluating to the body of a JavaScript function to be executed
* on the server to use when `direction` is not set.
*
* The code has access to three variables: `config`, `vertex`, `path`.
* The code must return an array of objects with `edge` and `vertex`
* attributes representing the connections for the vertex.
*
* **Note**: This code will be evaluated and executed on the
* server inside ArangoDB's embedded JavaScript environment and can not
* access any other variables.
*
* See the official ArangoDB documentation for
* {@link https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html | the JavaScript `@arangodb` module}
* for information about accessing the database from within ArangoDB's
* server-side JavaScript environment.
*/
expander?: string;
/**
* Direction of the traversal, relative to the starting vertex if `expander`
* is not set.
*/
direction?: "inbound" | "outbound" | "any";
/**
* Item iteration order.
*/
itemOrder?: "forward" | "backward";
/**
* Traversal strategy.
*/
strategy?: "depthfirst" | "breadthfirst";
/**
* Traversal order.
*/
order?: "preorder" | "postorder" | "preorder-expander";
/**
* Specifies uniqueness for vertices and edges.
*/
uniqueness?: {
/**
* Uniqueness for vertices.
*/
vertices?: "none" | "global" | "path";
/**
* Uniqueness for edges.
*/
edges?: "none" | "global" | "path";
};
/**
* If specified, only nodes in at least this depth will be visited.
*/
minDepth?: number;
/**
* If specified, only nodes in at most this depth will be visited.
*/
maxDepth?: number;
/**
* Maximum number of iterations before a traversal is aborted because of a
* potential endless loop.