Update default roles and filters

PUT /groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule

Modify the default roles and filters of a data source.

Path parameters

application/json

Body Required

The updated default rule configuration object.

Responses

  • 204

    Successfully modified the default rule.

  • 400 application/json

    Bad Request

    Hide response attribute Show response attribute object
    • error string

      Values are default rule does not exist or service default rule id mismatch.

PUT /groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule
curl \
 --request PUT 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"_id":"string","roles":[{"_id":"string","document_filters":{"read":{},"write":{}},"name":"string","apply_when":{},"read":{},"write":{},"insert":{},"delete":{},"search":{},"fields":{},"additional_fields":{"read":{},"write":{}}}],"filters":[{"_id":"string","name":"string","apply_when":{},"query":{},"projection":{"additionalProperty1":0,"additionalProperty2":0}}]}'
Request examples
{
  "_id": "string",
  "roles": [
    {
      "_id": "string",
      "document_filters": {
        "read": {},
        "write": {}
      },
      "name": "string",
      "apply_when": {},
      "read": {},
      "write": {},
      "insert": {},
      "delete": {},
      "search": {},
      "fields": {},
      "additional_fields": {
        "read": {},
        "write": {}
      }
    }
  ],
  "filters": [
    {
      "_id": "string",
      "name": "string",
      "apply_when": {},
      "query": {},
      "projection": {
        "additionalProperty1": 0,
        "additionalProperty2": 0
      }
    }
  ]
}
Response examples (400)
{
  "error": "default rule does not exist"
}