Create a Firestore document reference from a document path

Create a Firestore document reference from a document path

Code sample

Go

alovelaceRef := client.Doc("users/alovelace")

Java

// Reference to a document with id "alovelace" in the collection "users"
DocumentReference document = db.document("users/alovelace");

Node.js

const alovelaceDocumentRef = db.doc('users/alovelace');

Python

a_lovelace_ref = db.document(u'users/alovelace')

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser