If updateDbKeyspace is set to true, the underlying Db instance used to create the DbAdmin will have its
current working keyspace set to the newly created keyspace immediately (even if the keyspace isn't technically
yet created).
Example
// If using non-astra, this may be a common idiom: constclient = newDataAPIClient({ environment:'dse' }); constdb = client.db('<endpoint>', { token:'<token>' });
// Will internally call `db.useKeyspace('new_keyspace')` awaitdb.admin().createKeyspace('new_keyspace', { updateDbKeyspace:true, });
// Creates collections in keyspace `new_keyspace` by default now constcoll = db.createCollection('my_coll');
Represents the options for creating a keyspace on a non-Astra database (i.e. blocking options + keyspace creation options).
If no replication options are provided, it will default to
'SimpleStrategy'
with a replication factor of1
.See AstraAdminBlockingOptions for more options about blocking behavior.
If
updateDbKeyspace
is set to true, the underlyingDb
instance used to create theDbAdmin
will have its current working keyspace set to the newly created keyspace immediately (even if the keyspace isn't technically yet created).Example