I want to switch from a MySQL database to a Mongo database. Especially the syntax seems more user-friendly, but that's not important right now.
I want to write a user authentication login system which basically verifies the email & password sent by the user agains the database (and acts accordingly). As I'm not extremely familiar with MongoDB and its user system, I was wondering: Should I treat users as 'Documents in a Collection' with db.insert()
or should I create actual database users with db.createUser()
call?
The first option seems more SQL-like (in a MySQL database, I would create a table called users
with according columns), whereas the second option reminds me of users that have access to phpMyAdmin in order to monitor the database, but not users that actually use the application I am building.
I tried searching information on login systems with MongoDB but I couldn't really find anything that confirms or denies my intuitions.