[ Web Proxy ]
URL:
Viewing: https://firebase.google.com/docs/reference/unity/class/firebase/firestore/collection-reference [Back]  [Original]

Firebase.Firestore.CollectionReference Class Reference Skip to main content
Overview Fundamentals AI Build Run Reference Samples
Firebase [Firebase]
Send feedback Stay organized with collections Save and categorize content based on your preferences.

Firebase.Firestore.CollectionReference

A reference to a collection in a Firestore database.

Summary

The existence of this object does not imply that the collection currently exists in storage.

A CollectionReference can be used for adding documents, getting document references, and querying for documents (using the methods inherited from Query).

Inheritance

Inherits from: Firebase.Firestore.Query, IEquatable< CollectionReference >

Properties

Parent
The parent document, or null if this is a root collection.

Public attributes

Id => Proxy.id()
string
The final part of the complete collection path; this is the identity of the collection relative to its parent document.
Path => Proxy.path()
string
The complete collection path, including project and database ID.

Public functions

AddAsync(object documentData)
Asynchronously creates a document with the given data in this collection.
Document()
Creates a DocumentReference for a direct child document of this collection with a random ID.
Document(string path)
Creates a DocumentReference for a child document of this reference.
Equals(object obj)
override bool
Equals(CollectionReference other)
bool
GetHashCode()
override int
ToString()
override string

Properties

Parent

DocumentReference Parent

The parent document, or null if this is a root collection.

Public attributes

Id

string Id => Proxy.id()

The final part of the complete collection path; this is the identity of the collection relative to its parent document.

Path

string Path => Proxy.path()

The complete collection path, including project and database ID.

Public functions

AddAsync

Task AddAsync(
  object documentData
)

Asynchronously creates a document with the given data in this collection.

The document has a randomly generated ID.

Details
Parameters
documentData
The data for the document. Must not be null.
Returns
The reference for the newly-created document.

Document

DocumentReference Document()

Creates a DocumentReference for a direct child document of this collection with a random ID.

This performs no server-side operations; it only generates the appropriate DocumentReference.

Details
Returns
A DocumentReference to a child document of this collection with a random ID.

Document

DocumentReference Document(
  string path
)

Creates a DocumentReference for a child document of this reference.

Details
Parameters
path
The path to the document, relative to this collection. Must not be null, and must contain an odd number of slash-separated path elements.
Returns
A DocumentReference for the specified document.

Equals

override bool Equals(
  object obj
)

Equals

bool Equals(
  CollectionReference other
)

GetHashCode

override int GetHashCode()

ToString

override string ToString()
Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2022-07-27 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-07-27 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page