Create a Firestore collection reference

Create a Firestore collection reference

Code sample

Go

usersRef := client.Collection("users")

Java

// Reference to the collection "users"
CollectionReference collection = db.collection("users");

Node.js

const usersCollectionRef = db.collection('users');

Python

users_ref = db.collection(u'users')

Ruby

collection_ref = firestore.col "users"

What's next

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