How to selectively populate waterline associations via query param in sails.js

后端 未结 1 341
失恋的感觉
失恋的感觉 2020-12-30 03:32

By default, sails will populate all relationships within a model when it\'s corresponding API route is hit. Does anyone know if it\'s possible to toggle this functionality?

相关标签:
1条回答
  • 2020-12-30 04:07

    You just need to separate your assosiactions via comma, just like this:

    localhost:1337/tickets?populate=comments,owner&SOME_OTHER_PARAMS
    
    0 讨论(0)
提交回复
热议问题