Skip to content

Commit

Permalink
docs: Add the firestore_setup_client_create_with_project_id region tag (
Browse files Browse the repository at this point in the history
GoogleCloudPlatform#8251)

The Firestore quickstart_new_instance sample can be used to demonstrate setting up client using a project id.

With this region tag, we can include it into this doc: https://cloud.google.com/firestore/docs/samples/firestore-setup-client-create-with-project-id

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
Mariatta and parthea authored Aug 11, 2022
1 parent 7d766cd commit 3df11db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion firestore/cloud-client/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@

def quickstart_new_instance():
# [START firestore_setup_client_create]
# [START firestore_setup_client_create_with_project_id]
from google.cloud import firestore

# The `project` parameter is optional and represents which project the client
# will act on behalf of. If not supplied, the client falls back to the default
# project inferred from the environment.
db = firestore.Client(project='my-project-id')
# [END firestore_setup_client_create_with_project_id]
# [END firestore_setup_client_create]

return db
Expand Down Expand Up @@ -154,7 +156,7 @@ def to_dict(self):
# [END_EXCLUDE]

def __repr__(self):
return(
return (
f'City(\
name={self.name}, \
country={self.country}, \
Expand Down

0 comments on commit 3df11db

Please sign in to comment.