duanri1985 2016-03-02 14:52
浏览 54

使用PHP(Code Igniter)和MongoDB构建用户系统

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.

  • 写回答

1条回答 默认 最新

  • dongyouzhui1969 2016-03-02 15:14
    关注

    i think SQL is best choice to create login systems, but if you need to create login system using MongoDB you can create collection called user and field called username and password may this can help you enter link description here

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP