I am making an amatour project in which I want to connect to Google Cloud MongoDB from an android application.
The thing I have been reading about is that it is not a good practice to connect directly to this database as it exposes it to security threats. The correct solutions given were all centered around creating a REST API (PHP, JSON, Java API) or using MEAN Stack. Something else mentioned was that I can just use Java Mongo Driver to do the job and this seems like the most convenient approach.
I have 0 experience in this matter so I really don't know where to start. Could anyone suggest the best solution in this situation?
P.S. my info source:
Should I access mongodb directly?
https://mongodb.github.io/mongo-java-driver/