Created
April 17, 2018 04:39
-
-
Save ryanmats/3f3bb5b3672126871ca5c3f59650135e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "google/cloud/firestore" | |
firestore = Google::Cloud::Firestore.new | |
frank_ref = firestore.doc "users/frank" | |
frank_ref.set({ | |
name: "Frank", | |
favorites: { | |
food: "Pizza", | |
color: "Blue", | |
subject: "Recess" | |
}, | |
age: 12 | |
}) | |
nested_field_path = Google::Cloud::Firestore::FieldPath.new( | |
:favorites, :color | |
) | |
frank_ref.update({ age: 13, nested_field_path: "Red" }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment