【问题标题】:how to prevent users from overwriting each other's data如何防止用户覆盖彼此的数据
【发布时间】:2016-04-28 03:13:47
【问题描述】:

对于 pouchdb,它支持与服务器端数据库的远程同步。

http://pouchdb.com/guides/databases.html

但是,对于多用户应用程序,客户端似乎可以简单地将数据库名称更改为任何名称,甚至可能覆盖其他用户的数据。

如何防止这种情况?为每个用户创建一个单独的数据库?

【问题讨论】:

    标签: pouchdb


    【解决方案1】:

    “DB per user”是 CouchDB/PouchDB 中非常标准的身份验证模型。 (不用担心 - CouchDB 中的数据库很便宜。)有一些不同配方的示例 in the pouchdb-authentication README 以及 a more complex example 多个用户在他们之间共享部分数据。

    【讨论】:

      猜你喜欢
      • 2021-05-26
      • 1970-01-01
      • 2019-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-12
      相关资源
      最近更新 更多