application/json
body
-
연결된 MongoDB Atlas 데이터 소스의 이름입니다. 이는 일반적으로
"mongodb-atlas"
이지만 데이터 소스를 생성할 때 다른 이름을 선택한 경우 앱에서 해당 이름이 다를 수 있습니다. -
지정된 데이터 소스에 있는 데이터베이스의 이름입니다.
-
지정된 데이터베이스에 있는 컬렉션의 이름입니다.
-
문서와 일치하는 MongoDB 쿼리 필터입니다. 데이터 API가 지원하는 모든 쿼리 작업자 목록은 쿼리 작업자를 참조하세요.
-
작업에서 반환된 일치하는 문서에 대한 MongoDB 프로젝션입니다.
-
정렬된 필드 이름과 방향을 나타내는 MongoDB 정렬 표현식입니다.
-
응답에 포함할 일치하는 문서의 최대 수입니다.
-
응답에서 생략할 일치하는 문서 수입니다.
body
-
연결된 MongoDB Atlas 데이터 소스의 이름입니다. 이는 일반적으로
"mongodb-atlas"
이지만 데이터 소스를 생성할 때 다른 이름을 선택한 경우 앱에서 해당 이름이 다를 수 있습니다. -
지정된 데이터 소스에 있는 데이터베이스의 이름입니다.
-
지정된 데이터베이스에 있는 컬렉션의 이름입니다.
-
문서와 일치하는 MongoDB 쿼리 필터입니다. 데이터 API가 지원하는 모든 쿼리 작업자 목록은 쿼리 작업자를 참조하세요.
-
작업에서 반환된 일치하는 문서에 대한 MongoDB 프로젝션입니다.
-
정렬된 필드 이름과 방향을 나타내는 MongoDB 정렬 표현식입니다.
-
응답에 포함할 일치하는 문서의 최대 수입니다.
-
응답에서 생략할 일치하는 문서 수입니다.
POST /조치/찾기
curl -s "https://data.mongodb-api.com/app/$CLIENT_APP_ID/endpoint/data/v1/action/find" \
-X POST \
-H "apiKey: $API_KEY" \
-H 'Content-Type: application/ejson' \
-H "Accept: application/json" \
-d '{
"dataSource": "mongodb-atlas",
"database": "learn-data-api",
"collection": "tasks",
"filter": {
"status": "complete"
},
"sort": { "completedAt": 1 },
"limit": 10
}'
요청 예시
{
"sort": {
"completedAt": 1
},
"limit": 10,
"filter": {
"status": "complete"
},
"database": "todo",
"collection": "tasks",
"dataSource": "mongodb-atlas",
"projection": {
"text": 1,
"completedAt": 1
}
}
요청 예시
{
"sort": {
"completedAt": 1
},
"limit": 10,
"filter": {
"status": "complete"
},
"database": "todo",
"collection": "tasks",
"dataSource": "mongodb-atlas",
"projection": {
"text": 1,
"completedAt": 1
}
}
응답 예시(200)
{
"documents": [
{
"_id": "6193504e1be4ab27791c8133",
"text": "Do the dishes",
"completedAt": "2022-05-16T20:22:01.104Z"
},
{
"_id": "6194604e1d38dc33792d8257",
"text": "Feed the dog",
"completedAt": "2022-05-17T05:12:42.828Z"
}
]
}
응답 예시(200)
{
"documents": [
{
"_id": {
"$oid": "6193504e1be4ab27791c8133"
},
"text": "Do the dishes",
"completedAt": {
"$date": {
"$numberLong": "1652732521104"
}
}
},
{
"_id": {
"$oid": "6194604e1d38dc33792d8257"
},
"text": "Feed the dog",
"completedAt": {
"$date": {
"$numberLong": "1652764362828"
}
}
}
]
}
응답 예시(400)
Errornoauthenticationspecified
{
"error": "no authentication methods were specified",
"error_code": "InvalidParameter",
"link": "string"
}
{
"error": "must specify some form of authentication (either email+password, api-key, or jwt) in the request header or body",
"error_code": "MissingParameter",
"link": "string"
}
응답 예시(401)
{
"error": "invalid session: error finding user for endpoint",
"error_code": "InvalidSession",
"link": "string"
}