I am currently using firestore for a small application. I am trying to see what I can use for auto increment ids. A simple use case which is common is order nos. A human consumable identifier I dont want to use the document id. This is not consumable for humans.
相关问题
- Firebase security rules difference between get() a
- Firebase firestore not working with Angular Univer
- Firestore limit writing access per time
- MappedListIterable is not a SubType
- How to use arrayUnion with AngularFirestore?
相关文章
- Firestore Update a document field Using Rest API
- How to combine Firestore orderBy desc with startAf
- Firestore + cloud functions: How to read from anot
- Checking if a document exists in a Firestore colle
- Flutter how to use Future return value as if varia
- Flutter Firestore add new document with Custom ID
- Display duplicate events after update firestore da
- Firestore - get specific fields from document
There is no built-in auto-increment operator in Firestore. If you want something like that, you will have to build it yourself.
This typically involves keeping track of the latest ID you've used in a document in a well-known location, and then reading-and-updating that document from the client in a transaction.
But do seriously consider whether you can't use Firestore's built-in identifiers, as there are many reasons why Firestore comes with those built-in instead of having an auto-increment operator.
I highly recommend checking out some of these related questions:
And this page in the Firestore documentation in distributed counters.