I am making an API using Firebase Function & Firebase Cloud Firestore.
I am trying to use the Firestore for storing data about different users base on which the API will decide the results. The API will be used to detect fraud within my App. For the Same purpose I will be using multiple ID such as IMEI number, Android ID, UUID and one more ID which will be assigned by mu app.
I am using multiple IDs because the user can easily change the Android ID on a rooted device. Hence I will be using multiple IDs to detect a particular user.
But the problem How can I use Firestore to store data user wise so that a user could be located and his/her data on the Firestore could be used to make predictions.
I want to ahieve the following:
User(Collection)
|
|-->(IMEI, Android ID, UUID, ID)(Should be searchable using all the IDs)
|
|--> (A)Other Data Such As Activity ETC
|--> (B)Other Data such as Session ETC.
I know that I can create a Collection(eg users) and further use documents with any one of the users ID but how will it be possible to create a document which can be accessed by using any of the user ID ? I don't want to create multiple documents for the same user base as that will occupy my storage quota.
Any Help would be grateful. Thanks!