firebase / firebase/firebase-js-sdk

FirebaseError: Document already exists

Open
#5,549 49 comments 11 reactions 1 assignee Claimed by @MarkDuckworth View on GitHub
api: firestore bug
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [REQUIRED] Describe your environment

* Operating System version: Multiple (Windows 10, Android 10)
* Browser version: Multiple (Chrome Mobile 91.0.4472, Edge, Samsung Internet 13.0)
* Firebase SDK version: 8.4.3
* Firebase Product: Firestore

We are seeing this error when trying to add a document to a collection. I've scoured Google and Stack-Overflow, gone through the source code and also gprc source code. I can't understand the reason for this error:

`firebase.firestore().collection('some-collection').add({ data: 1 })`

As far as I can tell, this should never throw a "document exists" error. Is this valid behavior or a Firebase bug?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.