Execute a function

POST /groups/{groupId}/apps/{appId}/debug/execute_function

Execute a function for testing.

Path parameters

Query parameters

  • user_id string Required

    The user as which to execute the function. Either user_id or run_as_system is required. You cannot specify both.

  • run_as_system boolean Required

    Determine whether or not to run as system user. Either run_as_system or user_id is required. You cannot specify both.

application/json

Body Required

The function to execute.

  • service string

    The service to use when calling this function.

  • name string Required

    The name of the function you want to run.

  • arguments array[string]

    Any arguments that your function needs.

Responses

  • 200 application/json

    Successfully executed.

    Hide response attributes Show response attributes object
    • error object
    • result object
    • stats object
      Hide stats attribute Show stats attribute object
      • execution_time string
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"]}'
Request examples
{
  "service": "string",
  "name": "string",
  "arguments": [
    "string"
  ]
}
Response examples (200)
{
  "error": {},
  "result": {},
  "stats": {
    "execution_time": "string"
  }
}