Create default roles and filters
Create default roles and filters for a data source.
Path parameters
-
An Atlas Project/Group ID.
-
The ObjectID of your application. The App Services API Project and Application IDs section demonstrates how to find this value.
-
The unique
_id
value of a service.
Body
Required
A default rule configuration object.
-
An ordered list of default user roles.
-
A list of default query filters.
A filter that conditionally modifies incoming query operations before they run.
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":{"":{}},"name":"string","":{},"fields":{},"additional_fields":{"":{}}}],"filters":[{"name":"string","":{},"query":{},"projection":{"additionalProperty1":0,"additionalProperty2":0}}]}'
Request examples
{
"roles": [
{
"document_filters": {
"": {}
},
"name": "string",
"": {},
"fields": {},
"additional_fields": {
"": {}
}
}
],
"filters": [
{
"name": "string",
"": {},
"query": {},
"projection": {
"additionalProperty1": 0,
"additionalProperty2": 0
}
}
]
}
Response examples (201)
{
"_id": "string",
"roles": [
{
"_id": "string",
"document_filters": {
"": {}
},
"name": "string",
"": {},
"fields": {},
"additional_fields": {
"": {}
}
}
],
"filters": [
{
"_id": "string",
"name": "string",
"": {},
"query": {},
"projection": {
"additionalProperty1": 0,
"additionalProperty2": 0
}
}
]
}
Response examples (400)
{
"error": "default rule already exists"
}