Create a CosmosDB connection whitout using the “createIfNotExists”

Solution for Create a CosmosDB connection whitout using the “createIfNotExists”
is Given Below:

I’m using nodeJS and I’m trying to create a connection with the CosmosDB, I would like to know if I can do that without the use of “createIfNotExists”

const getCosmosClient = async (): Promise<Database> => {
  const { database } = await cosmosClient.databases.createIfNotExists({ id: DATABASES.databaseId });

  return database;
};

Glancing at the documentation, you can use cosmosClient.database(id). It should return a Database instead of a Promise<DatabaseResponse>.