module.exports = Self => { Self.remoteMethodCtx('collectionGet', { description: 'Get pending collections from a worker', accessType: 'WRITE', returns: { type: 'Object', root: true }, http: { path: `/collectionGet`, verb: 'POST' } }); Self.collectionGet = async ctx => { const userId = ctx.req.accessToken.userId; const query = `CALL vn.collection_get(?)`; const [result] = await Self.rawSql(query, [userId]); return result; }; };