收藏
回答

数据库函数subtract返回authorization field错误,哪不对?

云函数调用subtract比较时间,可以是提示错误{"code":"SIGN_PARAM_INVALID","message":"authorization field not exsit"}

exports.main = async (event, context) => {


  let currentTime = new Date()
  console.log(currentTime)
  
  let ret = await db.collection('DOCUMENTITEM').aggregate()
    .project({
      diff: $.subtract([currentTime, '$CreatedAt'])
    })
    .end()


  return {
    currentTime
  }
}


具体错误如图所示?请各位大神指导。

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签