application/json
body
-
연결된 MongoDB Atlas 데이터 소스의 이름입니다. 이는 일반적으로
"mongodb-atlas"
이지만 데이터 소스를 생성할 때 다른 이름을 선택한 경우 앱에서 해당 이름이 다를 수 있습니다. -
지정된 데이터 소스에 있는 데이터베이스의 이름입니다.
-
지정된 데이터베이스에 있는 컬렉션의 이름입니다.
-
문서와 일치하는 MongoDB 쿼리 필터입니다. 데이터 API가 지원하는 모든 쿼리 작업자 목록은 쿼리 작업자를 참조하세요.
-
작업에서 반환된 일치하는 문서에 대한 MongoDB 프로젝션입니다.
body
-
연결된 MongoDB Atlas 데이터 소스의 이름입니다. 이는 일반적으로
"mongodb-atlas"
이지만 데이터 소스를 생성할 때 다른 이름을 선택한 경우 앱에서 해당 이름이 다를 수 있습니다. -
지정된 데이터 소스에 있는 데이터베이스의 이름입니다.
-
지정된 데이터베이스에 있는 컬렉션의 이름입니다.
-
문서와 일치하는 MongoDB 쿼리 필터입니다. 데이터 API가 지원하는 모든 쿼리 작업자 목록은 쿼리 작업자를 참조하세요.
-
작업에서 반환된 일치하는 문서에 대한 MongoDB 프로젝션입니다.
POST /조치/findOne
curl -s "https://data.mongodb-api.com/app/$CLIENT_APP_ID/endpoint/data/v1/action/findOne" \
-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": {
"text": "Do the dishes"
}
}'
요청 예시
{
"filter": {
"text": "Do the dishes"
},
"database": "todo",
"collection": "tasks",
"dataSource": "mongodb-atlas",
"projection": {
"text": 1,
"status": 1
}
}
요청 예시
{
"filter": {
"text": "Do the dishes"
},
"database": "todo",
"collection": "tasks",
"dataSource": "mongodb-atlas",
"projection": {
"text": 1,
"status": 1
}
}
응답 예시(200)
{
"document": {
"_id": "6193504e1be4ab27791c8133",
"text": "Do the dishes",
"status": "open"
}
}
응답 예시(200)
{
"document": {
"_id": {
"$oid": "6193504e1be4ab27791c8133"
},
"text": "Do the dishes",
"status": "open"
}
}
응답 예시(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"
}