Skip to content

Commit b363fd3

Browse files
committed
Update code examples and a few test names due to renamed methods
1 parent 7bfca37 commit b363fd3

7 files changed

+17
-17
lines changed

src/collections.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ export interface DocumentCollection<
688688
* ```js
689689
* const db = new Database();
690690
* const collection = db.collection("some-collection");
691-
* const result = await collection.setProperties({ waitForSync: true });
691+
* const result = await collection.properties({ waitForSync: true });
692692
* // the collection will now wait for data being written to disk
693693
* // whenever a document is changed
694694
* ```

src/cursors.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ export class BatchCursor<ItemType = any> {
342342
* aql`FOR x IN 1..5 RETURN x`,
343343
* { batchSize: 1 }
344344
* );
345-
* console.log(cursor.hasMore); // true
345+
* console.log(cursor.batches.hasMore); // true
346346
* await cursor.batches.loadAll();
347-
* console.log(cursor.hasMore); // false
347+
* console.log(cursor.batches.hasMore); // false
348348
* console.log(cursor.hasNext); // true
349349
* for await (const item of cursor) {
350350
* console.log(item);
@@ -417,7 +417,7 @@ export class BatchCursor<ItemType = any> {
417417
* Advances the cursor by applying the `callback` function to each item in
418418
* the cursor's remaining result list until the cursor is depleted or
419419
* `callback` returns the exact value `false`. Returns a promise that
420-
* evalues to `true` unless the function returned `false`.
420+
* evaluates to `true` unless the function returned `false`.
421421
*
422422
* **Note**: If the result set spans multiple batches, any remaining batches
423423
* will only be fetched on demand. Depending on the cursor's TTL and the
@@ -732,14 +732,14 @@ export class BatchCursor<ItemType = any> {
732732
* @example
733733
* ```js
734734
* const cursor1 = await db.query(aql`FOR x IN 1..5 RETURN x`);
735-
* console.log(cursor1.hasMore); // false
735+
* console.log(cursor1.batches.hasMore); // false
736736
* await cursor1.kill(); // no effect
737737
*
738738
* const cursor2 = await db.query(
739739
* aql`FOR x IN 1..5 RETURN x`,
740740
* { batchSize: 2 }
741741
* );
742-
* console.log(cursor2.hasMore); // true
742+
* console.log(cursor2.batches.hasMore); // true
743743
* await cursor2.kill(); // cursor is depleted
744744
* ```
745745
*/
@@ -1220,14 +1220,14 @@ export class Cursor<ItemType = any> {
12201220
* @example
12211221
* ```js
12221222
* const cursor1 = await db.query(aql`FOR x IN 1..5 RETURN x`);
1223-
* console.log(cursor1.hasMore); // false
1223+
* console.log(cursor1.batches.hasMore); // false
12241224
* await cursor1.kill(); // no effect
12251225
*
12261226
* const cursor2 = await db.query(
12271227
* aql`FOR x IN 1..5 RETURN x`,
12281228
* { batchSize: 2 }
12291229
* );
1230-
* console.log(cursor2.hasMore); // true
1230+
* console.log(cursor2.batches.hasMore); // true
12311231
* await cursor2.kill(); // cursor is depleted
12321232
* ```
12331233
*/

src/databases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3067,7 +3067,7 @@ export class Database {
30673067
* ```js
30683068
* const db = new Database();
30693069
* // track up to 5 slow queries exceeding 5 seconds execution time
3070-
* await db.setQueryTracking({
3070+
* await db.queryTracking({
30713071
* enabled: true,
30723072
* trackSlowQueries: true,
30733073
* maxSlowQueries: 5,

src/test/06-managing-functions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("Managing functions", function () {
1818
system.close();
1919
}
2020
});
21-
describe("database.listFunctions", () => {
21+
describe("database.listUserFunctions", () => {
2222
it("should be empty per default", async () => {
2323
const result = await db.listUserFunctions();
2424
expect(result).to.be.instanceof(Array);
@@ -37,7 +37,7 @@ describe("Managing functions", function () {
3737
isDeterministic: false,
3838
});
3939
});
40-
describe("database.createFunction", () => {
40+
describe("database.createUserFunction", () => {
4141
it("should create a function", async () => {
4242
const info = await db.createUserFunction(
4343
"myfunctions::temperature::celsiustofahrenheit2",
@@ -47,7 +47,7 @@ describe("Managing functions", function () {
4747
expect(info).to.have.property("error", false);
4848
});
4949
});
50-
describe("database.dropFunction", () => {
50+
describe("database.dropUserFunction", () => {
5151
it("should drop a existing function", async () => {
5252
const name = "myfunctions::temperature::celsiustofahrenheit";
5353
await db.createUserFunction(

src/test/10-manipulating-collections.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe("Manipulating collections", function () {
6565
expect(info).to.have.property("type", 3); // edge collection
6666
});
6767
});
68-
describe("collection.setProperties", () => {
68+
describe("collection.properties", () => {
6969
it("should change properties", async () => {
7070
const info = await collection.properties({ waitForSync: true });
7171
expect(info).to.have.property("name", collection.name);

src/test/22-foxx-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ describe("Foxx service", () => {
855855
"getServiceDependencies",
856856
(mount: string) => db.getServiceDependencies(mount),
857857
],
858-
["listServiceScripts", (mount: string) => db.getServiceScripts(mount)],
858+
["getServiceScripts", (mount: string) => db.getServiceScripts(mount)],
859859
["upgradeService", (mount: string) => db.upgradeService(mount, {} as any)],
860860
[
861861
"updateServiceConfiguration",
@@ -882,11 +882,11 @@ describe("Foxx service", () => {
882882
["uninstallService", (mount: string) => db.uninstallService(mount)],
883883
["downloadService", (mount: string) => db.downloadService(mount)],
884884
[
885-
"enableServiceDevelopmentMode",
885+
"setServiceDevelopmentMode_true",
886886
(mount: string) => db.setServiceDevelopmentMode(mount, true),
887887
],
888888
[
889-
"disableServiceDevelopmentMode",
889+
"setServiceDevelopmentMode_false",
890890
(mount: string) => db.setServiceDevelopmentMode(mount, false),
891891
],
892892
[

src/test/24-accessing-views.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("Accessing views", function () {
2121
system.close();
2222
}
2323
});
24-
describe("database.arangoSearchView", () => {
24+
describe("database.view", () => {
2525
it("returns a View instance for the view", () => {
2626
const name = "potato";
2727
const view = db.view(name);

0 commit comments

Comments
 (0)