거래에 대한 참조입니다.
트랜잭션의 updateFunction
에 전달된 Transaction
객체는 트랜잭션 컨텍스트 내에서 데이터를 읽고 쓰는 방법을 제공합니다. runTransaction()을 참조하세요. .
서명:
export declare class Transaction
행동 양식
방법 | 수정자 | 설명 |
---|---|---|
삭제(문서참조) | 제공된 DocumentReference 에서 참조하는 문서를 삭제합니다. . | |
get(문서참조) | 제공된 DocumentReference 가 참조하는 문서를 읽습니다. . | |
세트(문서참조, 데이터) | 제공된 DocumentReference 에서 참조하는 문서에 씁니다. . 문서가 아직 존재하지 않으면 생성됩니다. | |
세트(documentRef, 데이터, 옵션) | 제공된 DocumentReference 에서 참조하는 문서에 씁니다. . 문서가 아직 존재하지 않으면 생성됩니다. merge 또는 mergeFields 제공하면 제공된 데이터를 기존 문서에 병합할 수 있습니다. | |
업데이트(문서참조, 데이터) | 제공된 DocumentReference 에서 참조하는 문서의 필드를 업데이트합니다. . 존재하지 않는 문서에 적용하면 업데이트가 실패합니다. | |
업데이트(documentRef, 필드, 값, moreFieldsAndValues) | 제공된 DocumentReference 에서 참조하는 문서의 필드를 업데이트합니다. . 존재하지 않는 문서에 적용하면 업데이트가 실패합니다. 중첩된 필드는 점으로 구분된 필드 경로 문자열을 제공하거나 FieldPath 개체를 제공하여 업데이트할 수 있습니다. |
트랜잭션.삭제()
제공된 DocumentReference 에서 참조하는 문서를 삭제합니다. .
서명:
delete<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>): this;
매개변수
매개변수 | 유형 | 설명 |
---|---|---|
문서참조 | 문서참조 <AppModelType, DbModelType> | 삭제할 문서에 대한 참조입니다. |
보고:
이것
이 Transaction
인스턴스. 체인 메서드 호출에 사용됩니다.
트랜잭션.get()
제공된 DocumentReference 가 참조하는 문서를 읽습니다. .
서명:
get<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>): Promise<DocumentSnapshot<AppModelType, DbModelType>>;
매개변수
매개변수 | 유형 | 설명 |
---|---|---|
문서참조 | 문서참조 <AppModelType, DbModelType> | 읽을 문서에 대한 참조입니다. |
보고:
약속< 문서스냅샷 <AppModelType, DbModelType>>
읽은 데이터가 포함된 DocumentSnapshot
.
트랜잭션.세트()
제공된 DocumentReference가 참조하는 문서에 씁니다. . 문서가 아직 존재하지 않으면 생성됩니다.
서명:
set<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>): this;
매개변수
매개변수 | 유형 | 설명 |
---|---|---|
문서참조 | 문서참조 <AppModelType, DbModelType> | 설정할 문서에 대한 참조입니다. |
데이터 | 필드값 포함 <앱모델 유형> | 문서에 대한 필드 및 값의 개체입니다. |
보고:
이것
이 Transaction
인스턴스. 체인 메서드 호출에 사용됩니다.
예외
오류 - 제공된 입력이 유효한 Firestore 문서가 아닌 경우입니다.
트랜잭션.세트()
제공된 DocumentReference 에서 참조하는 문서에 씁니다. . 문서가 아직 존재하지 않으면 생성됩니다. merge
또는 mergeFields
제공하는 경우 을 사용하면 제공된 데이터를 기존 문서에 병합할 수 있습니다.
서명:
set<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>, data: PartialWithFieldValue<AppModelType>, options: SetOptions): this;
매개변수
매개변수 | 유형 | 설명 |
---|---|---|
문서참조 | 문서참조 <AppModelType, DbModelType> | 설정할 문서에 대한 참조입니다. |
데이터 | PartialWithFieldValue <앱모델 유형> | 문서에 대한 필드 및 값의 개체입니다. |
옵션 | 옵션 설정 | 설정된 동작을 구성하는 개체입니다. |
보고:
이것
이 Transaction
인스턴스. 체인 메서드 호출에 사용됩니다.
예외
오류 - 제공된 입력이 유효한 Firestore 문서가 아닌 경우입니다.
거래.업데이트()
제공된 DocumentReference 에서 참조하는 문서의 필드를 업데이트합니다. . 존재하지 않는 문서에 적용하면 업데이트가 실패합니다.
서명:
update<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>, data: UpdateData<DbModelType>): this;
매개변수
매개변수 | 유형 | 설명 |
---|---|---|
문서참조 | 문서참조 <AppModelType, DbModelType> | 업데이트할 문서에 대한 참조입니다. |
데이터 | 업데이트데이터 <Db모델 유형> | 문서를 업데이트하는 데 사용할 필드와 값이 포함된 개체입니다. 필드에는 문서 내의 중첩된 필드를 참조하기 위한 점이 포함될 수 있습니다. |
보고:
이것
이 Transaction
인스턴스. 체인 메서드 호출에 사용됩니다.
예외
오류 - 제공된 입력이 유효한 Firestore 데이터가 아닌 경우입니다.
거래.업데이트()
제공된 DocumentReference 에서 참조하는 문서의 필드를 업데이트합니다. . 존재하지 않는 문서에 적용하면 업데이트가 실패합니다.
중첩된 필드는 점으로 구분된 필드 경로 문자열을 제공하거나 FieldPath
개체를 제공하여 업데이트할 수 있습니다.
서명:
update<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): this;
매개변수
매개변수 | 유형 | 설명 |
---|---|---|
문서참조 | 문서참조 <AppModelType, DbModelType> | 업데이트할 문서에 대한 참조입니다. |
필드 | 문자열 | 필드 경로 | 업데이트할 첫 번째 필드입니다. |
값 | 알려지지 않은 | 첫 번째 값입니다. |
moreFieldsAndValues | 알려지지 않은[] | 추가 키/값 쌍. |
보고:
이것
이 Transaction
인스턴스. 체인 메서드 호출에 사용됩니다.
예외
오류 - 제공된 입력이 유효한 Firestore 데이터가 아닌 경우입니다.