Interface ListCollectionsOptions

Options for listing collections.

Field

nameOnly - If true, only the name of the collections is returned. If false, the full collections info is returned. Defaults to true.

Field

keyspace - Overrides the keyspace to list collections from. If not provided, the default keyspace is used.

Field

timeout - The timeout override for this method

See

Db.listCollections

interface ListCollectionsOptions {
    keyspace?: string;
    nameOnly?: boolean;
    timeout?: number | Pick<Partial<TimeoutDescriptor>, "collectionAdminTimeoutMs" | "requestTimeoutMs">;
}

Hierarchy (view full)

Properties

keyspace?: string

The keyspace to use for the operation.

nameOnly?: boolean

If true, only the name of the collections is returned.

If false, the full collections info is returned.

Defaults to true.

Example

const names = await db.listCollections({ nameOnly: true });
console.log(names); // [{ name: 'my_coll' }]

const info = await db.listCollections({ nameOnly: false });
console.log(info); // [{ name: 'my_coll', options: { ... } }]

Default Value

true
timeout?: number | Pick<Partial<TimeoutDescriptor>, "collectionAdminTimeoutMs" | "requestTimeoutMs">

The method timeout override.

See TimeoutDescriptor for much more information.