컨텐츠로 바로가기

Getting Started

GitHub

설치

설치

AI 도움을 받아 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요:

터미널 창
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

그런 다음 다음 명령어를 사용하세요.

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-firebase-firestore` plugin in my project.

만약 Manual Setup을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요.

터미널 창
bun add @capgo/capacitor-firebase-firestore
bunx cap sync
import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';

__CAPGO_KEEP_0__을 지정된 데이터로 컬렉션에 새로운 문서를 추가합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.addDocument({} as AddDocumentOptions);

__CAPGO_KEEP_0__을 지정된 참조로 참조하는 문서에 쓰습니다. 만약 문서가 아직 존재하지 않으면 새로 생성됩니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.setDocument({} as SetDocumentOptions);

__CAPGO_KEEP_0__을 지정된 참조로 참조하는 문서를 읽습니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.getDocument({} as GetDocumentOptions);

__CAPGO_KEEP_0__을 지정된 참조로 참조하는 문서의 field를 업데이트합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.updateDocument({} as UpdateDocumentOptions);

__CAPGO_KEEP_0__을 지정한 참조에 의해 참조되는 문서를 삭제합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.deleteDocument({} as DeleteDocumentOptions);

__CAPGO_KEEP_3__ 단일 배치로 여러 쓰기 작업을 실행합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.writeBatch({} as WriteBatchOptions);

__CAPGO_KEEP_4__을 지정한 참조에 의해 참조되는 컬렉션을 읽습니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.getCollection({} as GetCollectionOptions);

getCollectionGroup

__CAPGO_KEEP_2__ 섹션

__CAPGO_KEEP_5__을 지정한 참조에 의해 참조되는 컬렉션 그룹을 읽습니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.getCollectionGroup({} as GetCollectionGroupOptions);

getCountFromServer

__CAPGO_KEEP_2__ 섹션

__CAPGO_KEEP_0__을(를) 문서 수집의 컬렉션에서 가져옵니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.getCountFromServer({} as GetCountFromServerOptions);

clearPersistence

clearPersistence

__CAPGO_KEEP_0__을(를) 지속적인 저장소에서 삭제합니다. 이에는 보류 중인 쓰기와 캐시된 문서가 포함됩니다.

__CAPGO_KEEP_0__을(를) 앱이 종료되거나 앱이 처음 초기화될 때 호출해야 합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.clearPersistence();

enableNetwork

enableNetwork

__CAPGO_KEEP_0__을(를) 네트워크 사용을 재개합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.enableNetwork();

disableNetwork

disableNetwork

__CAPGO_KEEP_0__을(를) 네트워크 사용을 중지합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.disableNetwork();

useEmulator

useEmulator

Firestore 에뮬레이터와 통신하기 위해 앱을 구성하십시오.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.useEmulator({} as UseEmulatorOptions);

addDocumentSnapshotListener

addDocumentSnapshotListener

문서 스냅샷 이벤트에 대한 리스너를 추가합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.addDocumentSnapshotListener({} as AddDocumentSnapshotListenerOptions, {} as AddDocumentSnapshotListenerCallback<T>);

addCollectionSnapshotListener

addCollectionSnapshotListener

컬렉션 스냅샷 이벤트에 대한 리스너를 추가합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.addCollectionSnapshotListener({} as AddCollectionSnapshotListenerOptions, {} as AddCollectionSnapshotListenerCallback<T>);

addCollectionGroupSnapshotListener

addCollectionGroupSnapshotListener

컬렉션 그룹 스냅샷 이벤트에 대한 리스너를 추가합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.addCollectionGroupSnapshotListener({} as AddCollectionGroupSnapshotListenerOptions, {} as AddCollectionGroupSnapshotListenerCallback<T>);

removeSnapshotListener

__CAPGO_KEEP_0__

__CAPGO_KEEP_1__

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.removeSnapshotListener({} as RemoveSnapshotListenerOptions);

__CAPGO_KEEP_3__

__CAPGO_KEEP_4__

AddDocumentOptions

__CAPGO_KEEP_5__
export interface AddDocumentOptions {
/**
* The reference as a string, with path components separated by a forward slash (`/`).
*
* @since 5.2.0
* @example 'users'
*/
reference: string;
/**
* An object containing the data for the new document.
*
* @since 5.2.0
* @example { first: 'Alan', last: 'Turing', born: 1912 }
*/
data: DocumentData;
}

AddDocumentResult

__CAPGO_KEEP_7__
export interface AddDocumentResult {
/**
* The reference of the newly added document.
*
* @since 5.2.0
*/
reference: DocumentReference;
}

SetDocumentOptions

__CAPGO_KEEP_9__
export interface SetDocumentOptions {
/**
* The reference as a string, with path components separated by a forward slash (`/`).
*
* @since 5.2.0
* @example 'users/Aorq09lkt1ynbR7xhTUx'
*/
reference: string;
/**
* An object containing the data for the new document.
*
* @since 5.2.0
* @example { first: 'Alan', last: 'Turing', born: 1912 }
*/
data: DocumentData;
/**
* Whether to merge the provided data with an existing document.
*
* @since 5.2.0
* @example true
* @default false
*/
merge?: boolean;
}

DocumentData

__CAPGO_KEEP_11__
export interface DocumentData {
/**
* A mapping between a field and its value.
*
* @since 5.2.0
*/
[field: string]: any;
}
export interface GetDocumentOptions {
/**
* The reference as a string, with path components separated by a forward slash (`/`).
*
* @since 5.2.0
*/
reference: string;
}
export interface GetDocumentResult<T> {
/**
* The current document contents.
*
* @since 5.2.0
*/
snapshot: DocumentSnapshot<T>;
}
export interface UpdateDocumentOptions {
/**
* The reference as a string, with path components separated by a forward slash (`/`).
*
* @since 5.2.0
*/
reference: string;
/**
* An object containing the data for the new document.
*
* @since 5.2.0
* @example { first: 'Alan', last: 'Turing', born: 1912 }
*/
data: DocumentData;
}

DeleteDocumentOptions

문서 삭제 옵션 섹션
export interface DeleteDocumentOptions {
/**
* The reference as a string, with path components separated by a forward slash (`/`).
*
* @since 5.2.0
*/
reference: string;
}
export interface WriteBatchOptions {
/**
* The operations to execute in the batch.
*
* @since 6.1.0
*/
operations: WriteBatchOperation[];
}
export interface GetCollectionOptions {
/**
* The reference as a string, with path components separated by a forward slash (`/`).
*
* @since 5.2.0
*/
reference: string;
/**
* The filter to apply.
*
* @since 5.2.0
*/
compositeFilter?: QueryCompositeFilterConstraint;
/**
* Narrow or order the set of documents to retrieve, but do not explicitly filter for document fields.
*
* @since 5.2.0
*/
queryConstraints?: QueryNonFilterConstraint[];
}
export interface GetCollectionResult<T> {
/**
* The documents in the collection.
*
* @since 5.2.0
*/
snapshots: DocumentSnapshot<T>[];
}
export interface GetCollectionGroupOptions {
/**
* The reference as a string, with path components separated by a forward slash (`/`).
*
* @since 5.2.0
*/
reference: string;
/**
* The filter to apply.
*
* @since 5.2.0
*/
compositeFilter?: QueryCompositeFilterConstraint;
/**
* Narrow or order the set of documents to retrieve, but do not explicitly filter for document fields.
*
* @since 5.2.0
*/
queryConstraints?: QueryNonFilterConstraint[];
}

이 페이지는 플러그인의 src/definitions.tsAPI이 업스트림에서 변경될 때마다 pubic을 다시 동기화하세요.

Getting Started에서 계속

Getting Started에서 계속 섹션 제목

이미지 사용 중입니다 시작하기 API 대시보드를 계획하고 API 운영을 위해 연결합니다. API 개요 API 개요의 구현 세부 정보에 대해 소개 소개의 구현 세부 정보에 대해 API 키 API 키의 구현 세부 정보에 대해 장치 장치의 구현 세부 정보에 대해 패키지 패키지의 구현 세부 정보에 대해