Execute raw query on MySQL Loopback Connector

后端 未结 2 1808
孤独总比滥情好
孤独总比滥情好 2020-12-29 12:21

How is it possible to execute raw query and expose results through REST API with strongloop?

I\'ve read something about using hooks and dataSource

2条回答
  •  醉话见心
    2020-12-29 13:06

    1. expose a remote method in your /common/models/model.js
    2. execute the sql query in the remote method (via dataSource.connector.query(sql, cb);

提交回复
热议问题