Sails.js隐藏协会的回应

我有一个sails.js中one-to-many关联模型:

 USER: attributes: { name: { type: "string", required: true, }, photos: { collection: "Photo", via: "user" } }, 

 PHOTO: attributes: { url: { type: "string", required: true }, user: { model: "user" } } 

但现在,我的问题是,当我通过简单的浏览到http://localhost:1337/user显示所有的用户,它显示用户模型与所有照片id id,我想有不同的路线获得相片。

是否有可能隐藏它,或者我需要从模型中删除它,然后用查询search照片?

您可以使用populate属性在sails.config.blueprints中configuration它。

我从来没有testing过,但尝试在config / blueprints.js中将populate属性添加到false