I am using Firestore for Android right now; recording some data and writing it to documents. Instead of creating document every time, I want to limit documents like 10 or some x number of fields. If a user writes to document and field count reaches x, the user will create new document in the same collection.
So my question is: How to avoid race conditions when creating new documents(multiple documents created by different users)? Is it feasible to use this method for split this kind of data to different documents?