기본 역할 및 필터 만들기 더 이상 사용되지 않습니다.

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

데이터 소스에 대한 기본 역할 및 필터를 만듭니다.

경로 매개변수

application/json

body 필수 사항

기본 규칙 구성 객체입니다.

응답

POST /groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule
curl \
 --request POST '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 '{"roles":[{"document_filters":{"read":{},"write":{}},"name":"string","apply_when":{},"read":{},"write":{},"insert":{},"delete":{},"search":{},"fields":{},"additional_fields":{"read":{},"write":{}}}],"filters":[{"name":"string","apply_when":{},"query":{},"projection":{"additionalProperty1":0,"additionalProperty2":0}}]}'
요청 예시
{
  "roles": [
    {
      "document_filters": {
        "read": {},
        "write": {}
      },
      "name": "string",
      "apply_when": {},
      "read": {},
      "write": {},
      "insert": {},
      "delete": {},
      "search": {},
      "fields": {},
      "additional_fields": {
        "read": {},
        "write": {}
      }
    }
  ],
  "filters": [
    {
      "name": "string",
      "apply_when": {},
      "query": {},
      "projection": {
        "additionalProperty1": 0,
        "additionalProperty2": 0
      }
    }
  ]
}
응답 예시(201)
{
  "_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
      }
    }
  ]
}
응답 예시(400)
{
  "error": "default rule already exists"
}