天天看點

微搭低代碼的自定義方法使用文法舉例

以前叫做自定義方法,現在更名成了api了

截圖和文字放下面,以後忘了可以來找

微搭低代碼的自定義方法使用文法舉例

const fetch = require('node-fetch');

module.exports = async function (params, context) {

  const db = context.database

  const _ = db.command

  const result = await db.collection('lcap-data-2mbZPdaue-cs_p8sd9aa-preview')

  .where({

      age: _.and(_.gt(26), _.lt(36))

    })

  .get();

  // 在這裡傳回這個方法的結果,需要與出參定義的結構映射

  return result.data

};

其中,集合的名字,不是集合辨別,而是雲資料庫名,在雲資料庫去尋找

 登入 - 騰訊雲

附上截圖

微搭低代碼的自定義方法使用文法舉例

就是箭頭的那個位置的名字,就是雲資料庫名 

繼續閱讀