限制对MongoDB中特定字段的访问?

时间:2016-08-24 12:00:02

标签: mongodb parse-platform database-schema

我在MongoDb中有一个 angular.module('service', ['ionic']) .service('BBNService', ["$localStorage", "$ionicPlatform", function ($localStorage, $ionicPlatform) { }]); 类,我不希望将_User这样的敏感项作为返回查询(除非发送了正确的会话令牌)。

我可以像email那样设置CLP:

```

_Schema

```

我不希望隐藏整个类 - 例如,我希望将 "_metadata": { "class_permissions": { "get": { "*": true }, "find": { "*": true }, "update": { "*": true }, "create": { "*": true }, "delete": { "*": true }, "addField": { "*": true }, "readUserFields": [], "writeUserFields": [] } }, "username": "string", "email": "string"... get保持为公开可读。我只是想隐藏某些列。

如上所示,我在字段find上找不到任何文档,也没有帮助在其中添加字段,即readUserFields

如果有帮助,这个数据库结构是从https://parse.com迁移的 - 但我相信这个问题与整个MongoDB更相关; Parse社区没有关于此的有用信息。

任何帮助将不胜感激!

0 个答案:

没有答案