Skip to content

Update code examples and a few test names due to renamed methods #826

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ export interface DocumentCollection<
* ```js
* const db = new Database();
* const collection = db.collection("some-collection");
* const result = await collection.setProperties({ waitForSync: true });
* const result = await collection.properties({ waitForSync: true });
* // the collection will now wait for data being written to disk
* // whenever a document is changed
* ```
Expand Down
14 changes: 7 additions & 7 deletions src/cursors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ export class BatchCursor<ItemType = any> {
* aql`FOR x IN 1..5 RETURN x`,
* { batchSize: 1 }
* );
* console.log(cursor.hasMore); // true
* console.log(cursor.batches.hasMore); // true
* await cursor.batches.loadAll();
* console.log(cursor.hasMore); // false
* console.log(cursor.batches.hasMore); // false
* console.log(cursor.hasNext); // true
* for await (const item of cursor) {
* console.log(item);
Expand Down Expand Up @@ -417,7 +417,7 @@ export class BatchCursor<ItemType = any> {
* Advances the cursor by applying the `callback` function to each item in
* the cursor's remaining result list until the cursor is depleted or
* `callback` returns the exact value `false`. Returns a promise that
* evalues to `true` unless the function returned `false`.
* evaluates to `true` unless the function returned `false`.
*
* **Note**: If the result set spans multiple batches, any remaining batches
* will only be fetched on demand. Depending on the cursor's TTL and the
Expand Down Expand Up @@ -732,14 +732,14 @@ export class BatchCursor<ItemType = any> {
* @example
* ```js
* const cursor1 = await db.query(aql`FOR x IN 1..5 RETURN x`);
* console.log(cursor1.hasMore); // false
* console.log(cursor1.batches.hasMore); // false
* await cursor1.kill(); // no effect
*
* const cursor2 = await db.query(
* aql`FOR x IN 1..5 RETURN x`,
* { batchSize: 2 }
* );
* console.log(cursor2.hasMore); // true
* console.log(cursor2.batches.hasMore); // true
* await cursor2.kill(); // cursor is depleted
* ```
*/
Expand Down Expand Up @@ -1220,14 +1220,14 @@ export class Cursor<ItemType = any> {
* @example
* ```js
* const cursor1 = await db.query(aql`FOR x IN 1..5 RETURN x`);
* console.log(cursor1.hasMore); // false
* console.log(cursor1.batches.hasMore); // false
* await cursor1.kill(); // no effect
*
* const cursor2 = await db.query(
* aql`FOR x IN 1..5 RETURN x`,
* { batchSize: 2 }
* );
* console.log(cursor2.hasMore); // true
* console.log(cursor2.batches.hasMore); // true
* await cursor2.kill(); // cursor is depleted
* ```
*/
Expand Down
2 changes: 1 addition & 1 deletion src/databases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3067,7 +3067,7 @@ export class Database {
* ```js
* const db = new Database();
* // track up to 5 slow queries exceeding 5 seconds execution time
* await db.setQueryTracking({
* await db.queryTracking({
* enabled: true,
* trackSlowQueries: true,
* maxSlowQueries: 5,
Expand Down
6 changes: 3 additions & 3 deletions src/test/06-managing-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("Managing functions", function () {
system.close();
}
});
describe("database.listFunctions", () => {
describe("database.listUserFunctions", () => {
it("should be empty per default", async () => {
const result = await db.listUserFunctions();
expect(result).to.be.instanceof(Array);
Expand All @@ -37,7 +37,7 @@ describe("Managing functions", function () {
isDeterministic: false,
});
});
describe("database.createFunction", () => {
describe("database.createUserFunction", () => {
it("should create a function", async () => {
const info = await db.createUserFunction(
"myfunctions::temperature::celsiustofahrenheit2",
Expand All @@ -47,7 +47,7 @@ describe("Managing functions", function () {
expect(info).to.have.property("error", false);
});
});
describe("database.dropFunction", () => {
describe("database.dropUserFunction", () => {
it("should drop a existing function", async () => {
const name = "myfunctions::temperature::celsiustofahrenheit";
await db.createUserFunction(
Expand Down
2 changes: 1 addition & 1 deletion src/test/10-manipulating-collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("Manipulating collections", function () {
expect(info).to.have.property("type", 3); // edge collection
});
});
describe("collection.setProperties", () => {
describe("collection.properties", () => {
it("should change properties", async () => {
const info = await collection.properties({ waitForSync: true });
expect(info).to.have.property("name", collection.name);
Expand Down
6 changes: 3 additions & 3 deletions src/test/22-foxx-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ describe("Foxx service", () => {
"getServiceDependencies",
(mount: string) => db.getServiceDependencies(mount),
],
["listServiceScripts", (mount: string) => db.getServiceScripts(mount)],
["getServiceScripts", (mount: string) => db.getServiceScripts(mount)],
["upgradeService", (mount: string) => db.upgradeService(mount, {} as any)],
[
"updateServiceConfiguration",
Expand All @@ -882,11 +882,11 @@ describe("Foxx service", () => {
["uninstallService", (mount: string) => db.uninstallService(mount)],
["downloadService", (mount: string) => db.downloadService(mount)],
[
"enableServiceDevelopmentMode",
"setServiceDevelopmentMode_true",
(mount: string) => db.setServiceDevelopmentMode(mount, true),
],
[
"disableServiceDevelopmentMode",
"setServiceDevelopmentMode_false",
(mount: string) => db.setServiceDevelopmentMode(mount, false),
],
[
Expand Down
2 changes: 1 addition & 1 deletion src/test/24-accessing-views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("Accessing views", function () {
system.close();
}
});
describe("database.arangoSearchView", () => {
describe("database.view", () => {
it("returns a View instance for the view", () => {
const name = "potato";
const view = db.view(name);
Expand Down