Execute a function's source code for testing

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

Execute a function's source code 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 source to execute.

  • eval_source string

    This JSON expression must evaluate to true before the function may run. If this field is blank, it will evaluate to true.

  • source string Required

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_source
curl \
 --request POST 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/debug/execute_function_source?user_id=string&run_as_system=true' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"eval_source":"string","source":"string"}'
Request examples
{
  "eval_source": "string",
  "source": "string"
}
Response examples (200)
{
  "error": {},
  "result": {},
  "stats": {
    "execution_time": "string"
  }
}