@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) public @interface DocumentId
DocumentSnapshot.toObject(java.lang.Class<T>)
).
DocumentReference
.
DocumentSnapshot.toObject(java.lang.Class<T>)
or DocumentReference.get()
.
When using a POJO to write to a document (via DocumentReference.set(java.util.Map<java.lang.String, java.lang.Object>)
or @UpdateBuilder.set(com.google.cloud.firestore.DocumentReference, java.util.Map<java.lang.String, java.lang.Object>)
), the property annotated by @DocumentId is ignored, which allows writing the POJO
back to any document, even if it's not the origin of the POJO.
Copyright © 2023 Google LLC. All rights reserved.