public final class CollectionReference extends Query
Query.Direction| Modifier and Type | Method and Description |
|---|---|
com.google.api.core.ApiFuture<DocumentReference> |
add(Map<String,Object> fields)
Adds a new document to this collection with the specified data, assigning it a document ID
automatically.
|
com.google.api.core.ApiFuture<DocumentReference> |
add(Object pojo)
Adds a new document to this collection with the specified POJO as contents, assigning it a
document ID automatically.
|
DocumentReference |
document()
Returns a DocumentReference pointing to a new document with an auto-generated ID within this
collection.
|
DocumentReference |
document(String childPath)
Gets a DocumentReference instance that refers to the document that is a child of this
Collection.
|
String |
getId()
The id of a collection refers to the last component of path pointing to a collection, e.g.
|
DocumentReference |
getParent()
Returns a DocumentReference to the containing Document if this is a subcollection, else null.
|
String |
getPath()
A string representing the path of the referenced collection (relative to the root of the
database).
|
endAt, endBefore, equals, get, getFirestore, hashCode, limit, offset, orderBy, orderBy, orderBy, orderBy, select, select, startAfter, startAt, stream, whereEqualTo, whereEqualTo, whereGreaterThan, whereGreaterThan, whereGreaterThanOrEqualTo, whereGreaterThanOrEqualTo, whereLessThan, whereLessThan, whereLessThanOrEqualTo, whereLessThanOrEqualTo@Nonnull public String getId()
@Nullable public DocumentReference getParent()
@Nonnull public String getPath()
@Nonnull public DocumentReference document()
@Nonnull public DocumentReference document(@Nonnull String childPath)
childPath - A relative and slash-separated path to a document.@Nonnull public com.google.api.core.ApiFuture<DocumentReference> add(@Nonnull Map<String,Object> fields)
fields - A Map containing the data for the new document.document()public com.google.api.core.ApiFuture<DocumentReference> add(Object pojo)
pojo - The POJO that will be used to populate the contents of the documentdocument()Copyright © 2017 Google. All rights reserved.