MCPcopy Create free account
hub / github.com/NativeScript/firebase / add

Method add

packages/firebase-firestore/index.android.ts:792–807  ·  view source on GitHub ↗
(data: T)

Source from the content-addressed store, hash-verified

790 }
791
792 add(data: T) {
793 return new Promise<DocumentReference<T>>((resolve, reject) => {
794 org.nativescript.firebase.firestore.FirebaseFirestore.CollectionReference.add(
795 this.native,
796 serializeItems(data),
797 new org.nativescript.firebase.firestore.FirebaseFirestore.Callback<com.google.firebase.firestore.DocumentReference>({
798 onSuccess(ref) {
799 resolve(DocumentReference.fromNative(ref));
800 },
801 onError(error) {
802 reject(FirebaseError.fromNative(error));
803 },
804 })
805 );
806 });
807 }
808
809 doc(documentPath?: string) {
810 return DocumentReference.fromNative(documentPath ? this.native.document(documentPath) : this.native.document());

Callers

nothing calls this directly

Calls 2

serializeItemsFunction · 0.70
addMethod · 0.65

Tested by

no test coverage detected