Optional keyspaceThe keyspace to use for the operation.
Optional maxThis temporary error-ing property exists for migration convenience, and will be removed in a future version.
maxTimeMS option is no longer available; the timeouts system has been overhauled, and timeouts should now be set using timeout, and defaults in timeoutDefaults. You may generally Ctrl+R replace maxTimeMS with timeout to retain the same behavior.Optional nameIf true, only the name of the collections is returned.
If false, the full collections info is returned.
Defaults to true.
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: { ... } }]
true
Optional namespaceThis temporary error-ing property exists for migration convenience, and will be removed in a future version.
namespace terminology has been removed, and replaced with keyspace throughout the client.Optional timeoutThe method timeout override.
See TimeoutDescriptor for much more information.
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