Azure/azure-cosmos-python

No method get_database_client in CosmosClient

Opened this issue · 2 comments

The documentation and examples point to the method get_database_client(database) to get a database by ID. Python3 runtime throws an error that such method doesn't exist.

In fact, calling of dir() on a CosmosClient instance gives the list of methods not at all listed in the documentation, and it's consistent with the source code right here.

Documentation seems to be completely out of sync.

Yep. I came here because I wanted to log the same issue.
The solution is to remove these lines:

database = client.get_database_client(database_name)
container = database.get_container_client(container_name)

The QueryItems method is directly on the CosmosClient class, which makes sense IMHO. The documentation about the "query" example is out of sync. By the way, an example on how to use continuation tokens would be nice.

Looks like the latest version of the package fixes this.