Module: Google::Cloud::Firestore
- Defined in:
- lib/google/cloud/firestore.rb,
lib/google/cloud/firestore/batch.rb,
lib/google/cloud/firestore/query.rb,
lib/google/cloud/firestore/client.rb,
lib/google/cloud/firestore/convert.rb,
lib/google/cloud/firestore/service.rb,
lib/google/cloud/firestore/v1beta1.rb,
lib/google/cloud/firestore/version.rb,
lib/google/cloud/firestore/generate.rb,
lib/google/cloud/firestore/field_path.rb,
lib/google/cloud/firestore/credentials.rb,
lib/google/cloud/firestore/field_value.rb,
lib/google/cloud/firestore/transaction.rb,
lib/google/cloud/firestore/watch/order.rb,
lib/google/cloud/firestore/query_listener.rb,
lib/google/cloud/firestore/query_snapshot.rb,
lib/google/cloud/firestore/watch/listener.rb,
lib/google/cloud/firestore/commit_response.rb,
lib/google/cloud/firestore/document_change.rb,
lib/google/cloud/firestore/watch/inventory.rb,
lib/google/cloud/firestore/document_listener.rb,
lib/google/cloud/firestore/document_snapshot.rb,
lib/google/cloud/firestore/document_reference.rb,
lib/google/cloud/firestore/v1beta1/credentials.rb,
lib/google/cloud/firestore/collection_reference.rb,
lib/google/cloud/firestore/watch/enumerator_queue.rb,
lib/google/cloud/firestore/v1beta1/firestore_client.rb
Overview
Cloud Firestore
Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. While the Cloud Firestore interface has many of the same features as traditional databases, as a NoSQL database it differs from them in the way it describes relationships between data objects.
See Firestore Overview.
Defined Under Namespace
Modules: V1beta1 Classes: Batch, Client, CollectionReference, CommitResponse, Credentials, DocumentChange, DocumentListener, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Query, QueryListener, QuerySnapshot, Transaction
Constant Summary collapse
- VERSION =
"0.23.0".freeze
Class Method Summary collapse
-
.configure {|Google::Cloud.configure.firestore| ... } ⇒ Google::Cloud::Config
Configure the Google Cloud Firestore library.
-
.new(project_id: nil, credentials: nil, scope: nil, timeout: nil, client_config: nil, project: nil, keyfile: nil) ⇒ Google::Cloud::Firestore::Client
Creates a new object for connecting to the Firestore service.
Class Method Details
.configure {|Google::Cloud.configure.firestore| ... } ⇒ Google::Cloud::Config
Configure the Google Cloud Firestore library.
The following Firestore configuration parameters are supported:
project_id
- (String) Identifier for a Firestore project. (The parameterproject
is considered deprecated, but may also be used.)credentials
- (String, Hash, Google::Auth::Credentials) The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object. (See Credentials) (The parameterkeyfile
is considered deprecated, but may also be used.)scope
- (String, Array) The OAuth 2.0 scopes controlling the set of resources and operations that the connection can access. timeout
- (Integer) Default timeout to use in requests.client_config
- (Hash) A hash of values to override the default behavior of the API client.
113 114 115 116 117 |
# File 'lib/google/cloud/firestore.rb', line 113 def self.configure yield Google::Cloud.configure.firestore if block_given? Google::Cloud.configure.firestore end |
.new(project_id: nil, credentials: nil, scope: nil, timeout: nil, client_config: nil, project: nil, keyfile: nil) ⇒ Google::Cloud::Firestore::Client
Creates a new object for connecting to the Firestore service. Each call creates a new connection.
For more information on connecting to Google Cloud see the Authentication Guide.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/google/cloud/firestore.rb', line 70 def self.new project_id: nil, credentials: nil, scope: nil, timeout: nil, client_config: nil, project: nil, keyfile: nil project_id ||= (project || default_project_id) project_id = project_id.to_s # Always cast to a string raise ArgumentError, "project_id is missing" if project_id.empty? scope ||= configure.scope timeout ||= configure.timeout client_config ||= configure.client_config credentials ||= (keyfile || default_credentials(scope: scope)) unless credentials.is_a? Google::Auth::Credentials credentials = Firestore::Credentials.new credentials, scope: scope end Firestore::Client.new( Firestore::Service.new( project_id, credentials, timeout: timeout, client_config: client_config ) ) end |