diff --git a/app/lib/Collections/listCollections.js b/app/lib/Collections/listCollections.js index c512a737..d8c9d2c1 100644 --- a/app/lib/Collections/listCollections.js +++ b/app/lib/Collections/listCollections.js @@ -8,7 +8,7 @@ async function listCollections(databaseName, suppressAuth, filter, listOptions) try { const { safeCollectionFilter, safeCollectionOptions } = await (0, validator_1.validateParams)({ databaseName, suppressAuth, collectionFilter: filter, collectionOptions: listOptions }, ["databaseName"], "listCollections"); const { database } = await (0, connection_helpers_1.connectionHandler)(`${databaseName}/`, suppressAuth); - return await database.listCollections(safeCollectionFilter, safeCollectionOptions).toArray(); + return await database.listCollections(safeCollectionFilter || undefined, safeCollectionOptions || undefined).toArray(); } catch (err) { (0, error_manager_1.kaptanLogar)("00022", `when listing all collections in a database, details: ${err}`); diff --git a/app/src/Collections/listCollections.ts b/app/src/Collections/listCollections.ts index fb9d79f7..49f0594a 100644 --- a/app/src/Collections/listCollections.ts +++ b/app/src/Collections/listCollections.ts @@ -3,7 +3,7 @@ import type { Document, ListCollectionsOptions, CollectionInfo } from 'mongodb/m import { validateParams } from '../Helpers/validator'; import { kaptanLogar } from '../Errors/error_manager'; -export async function listCollections(databaseName: string, suppressAuth?: boolean, filter?: Document, listOptions?: ListCollectionsOptions): Promise { +export async function listCollections(databaseName: string, suppressAuth: boolean, filter?: Document, listOptions?: ListCollectionsOptions): Promise { try { const { safeCollectionFilter, safeCollectionOptions } = await validateParams<"listCollections">( { databaseName, suppressAuth, collectionFilter: filter, collectionOptions: listOptions }, @@ -12,7 +12,7 @@ export async function listCollections(databaseName: string, suppressAuth?: boole ); const { database } = await connectionHandler(`${databaseName}/`, suppressAuth); - return await database.listCollections(safeCollectionFilter, safeCollectionOptions).toArray(); + return await database.listCollections(safeCollectionFilter || undefined, safeCollectionOptions || undefined).toArray(); } catch (err) { kaptanLogar("00022", `when listing all collections in a database, details: ${err}`); } diff --git a/app/weivdata.d.ts b/app/weivdata.d.ts index 48c69d21..c7b6561c 100644 --- a/app/weivdata.d.ts +++ b/app/weivdata.d.ts @@ -1318,7 +1318,7 @@ declare module '@exweiv/weiv-data' { * @param listOptions MongoDB native listCollections options. [Read More](https://mongodb.github.io/node-mongodb-native/6.6/classes/Db.html#listCollections). * @returns Fulfilled - Array of [CollectionInfo](https://mongodb.github.io/node-mongodb-native/6.6/interfaces/CollectionInfo.html). */ - function listCollections(databaseName: string, suppressAuth?: boolean, filter?: Document, listOptions?: ListCollectionsOptions): Promise; + function listCollections(databaseName: string, suppressAuth: boolean, filter?: Document, listOptions?: ListCollectionsOptions): Promise; /** * @description diff --git a/docs/functions/Hooks.afterCount.html b/docs/functions/Hooks.afterCount.html index b1af0042..24da41ef 100644 --- a/docs/functions/Hooks.afterCount.html +++ b/docs/functions/Hooks.afterCount.html @@ -3,10 +3,10 @@
  • context: HookContext

    Contextual information about the hook.

  • Returns Promise<number> | number

    The count to return to count() instead of the original count. Returning a rejected promise will not block the operation, but will return a rejected promise to the caller as well as trigger the onFailure() hook.

    A hook that is triggered after a count() operation.

    -