application/json
POST /조치/insertMany
curl -s "https://data.mongodb-api.com/app/$CLIENT_APP_ID/endpoint/data/v1/action/insertMany" \
-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",
"documents": [
{
"status": "open",
"text": "Mop the floor"
},
{
"status": "open",
"text": "Clean the windows"
}
]
}'
요청 예시
{
"database": "todo",
"documents": [
{
"text": "Mop the floor",
"status": "open"
},
{
"text": "Clean the windows",
"status": "open"
}
],
"collection": "tasks",
"dataSource": "mongodb-atlas"
}
요청 예시
{
"database": "todo",
"documents": [
{
"text": "Mop the floor",
"status": "open"
},
{
"text": "Clean the windows",
"status": "open"
}
],
"collection": "tasks",
"dataSource": "mongodb-atlas"
}
응답 예시(200)
{
"insertedIds": [
"61935189ec53247016a623c9",
"61935189ec53247016a623ca"
]
}
응답 예시(200)
{
"insertedIds": [
{
"$oid": "61935189ec53247016a623c9"
},
{
"$oid": "61935189ec53247016a623ca"
}
]
}
응답 예시(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"
}