lib/google/cloud/firestore/transaction.rb in google-cloud-firestore-0.21.0 vs lib/google/cloud/firestore/transaction.rb in google-cloud-firestore-0.21.1
- old
+ new
@@ -79,13 +79,13 @@
# @!group Access
##
# Retrieves a list of document snapshots.
#
- # @param [String, DocumentReference] docs One or more strings
- # representing the path of the document, or document reference
- # objects.
+ # @param [String, DocumentReference, Array<String|DocumentReference>]
+ # docs One or more strings representing the path of the document, or
+ # document reference objects.
#
# @yield [documents] The block for accessing the document snapshots.
# @yieldparam [DocumentSnapshot] document A document snapshot.
#
# @return [Enumerator<DocumentSnapshot>] document snapshots list.
@@ -115,11 +115,11 @@
results = service.get_documents \
doc_paths, transaction: transaction_or_create
results.each do |result|
extract_transaction_from_result! result
next if result.result.nil?
- yield DocumentSnapshot.from_batch_result(result, self)
+ yield DocumentSnapshot.from_batch_result(result, client)
end
end
alias get_docs get_all
alias get_documents get_all
alias find get_all
@@ -134,16 +134,16 @@
# A string representing the path of a document or collection, a
# document reference object, a collection reference object, or a query
# to run.
#
# @yield [documents] The block for accessing the document snapshots.
- # @yieldparam [DocumentReference] document A document snapshot.
+ # @yieldparam [DocumentSnapshot] document A document snapshot.
#
- # @return [DocumentReference, Enumerator<DocumentReference>] A
- # single document snapshot when passed a document path a document
- # reference, or a list of document snapshots when passed other valid
- # values.
+ # @return [DocumentSnapshot, Enumerator<DocumentSnapshot>] A
+ # single document snapshot when passed a document path or a document
+ # reference object, or a list of document snapshots when passed other
+ # valid values.
#
# @example Get a document snapshot given a document path:
# require "google/cloud/firestore"
#
# firestore = Google::Cloud::Firestore.new
@@ -228,11 +228,11 @@
results = service.run_query obj.parent_path, obj.query,
transaction: transaction_or_create
results.each do |result|
extract_transaction_from_result! result
next if result.document.nil?
- yield DocumentSnapshot.from_query_result(result, self)
+ yield DocumentSnapshot.from_query_result(result, client)
end
end
alias run get
# @!endgroup
@@ -425,15 +425,13 @@
# @example Directly update a deeply-nested field with a `FieldPath`:
# require "google/cloud/firestore"
#
# firestore = Google::Cloud::Firestore.new
#
- # nested_field_path = Google::Cloud::Firestore::FieldPath.new(
- # :favorites, :food
- # )
+ # nested_field_path = firestore.field_path :favorites, :food
#
# firestore.transaction do |tx|
- # tx.update("users/frank", { nested_field_path: "Pasta" })
+ # tx.update("users/frank", { nested_field_path => "Pasta" })
# end
#
# @example Update a document using a document reference:
# require "google/cloud/firestore"
#