执行函数

发布 /groups/{groupId}/apps/{appId}/debug/execute_function

执行函数进行测试。

路径参数

查询参数

  • user_id 字符串 必需

    执行函数的用户。需要 user_idrun_as_system。您不能同时指定两者。

  • run_as_system 布尔 必需

    确定是否以系统用户身份运行。需要 run_as_systemuser_id。不能同时指定两者。

application/json

body 必需

要执行的函数。

  • 服务 字符串

    调用此函数时要使用的服务。

  • 名称 字符串 必需

    要运行的函数名称。

  • arguments array[string]

    函数需要的任何参数。

响应

  • 200 application/json

    已成功执行。

    隐藏响应属性 显示响应属性 对象
    • 错误 对象
    • 结果 对象
    • stats 对象
      隐藏统计信息属性 显示统计信息属性 对象
      • execution_time 字符串
POST /groups/{groupId}/apps/{appId}/debug/execute_function
curl \
 --request POST 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/debug/execute_function?user_id=string&run_as_system=true' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"service":"string","name":"string","arguments":["string"]}'
请求示例
{
  "service": "string",
  "name": "string",
  "arguments": [
    "string"
  ]
}
响应示例 (200)
{
  "error": {},
  "result": {},
  "stats": {
    "execution_time": "string"
  }
}