> For the complete documentation index, see [llms.txt](https://koonkim.gitbook.io/mongodb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://koonkim.gitbook.io/mongodb/appendix/utils/mongoimport.md).

# mongoimport

## 개요&#x20;

* MongoDB 서버에 데이터를 불러오기 위해서는 여러가지 방법 중 `mongoimport`는 MongoDB에서 제공하는 유틸리티이다.
* 실행 파일 형태로 제공되므로, 터미널 환경의 `bash` 나 윈도우 환경의 `cmd` 상에서 실행하면 된다.
* JSON, CSV, TXT 등의 여러가지 포멧을 지원하며, 기본적으로 JSON 파일을 불러올 수 있다.
* Ubuntu 등에서는 `mongodb-org-tools` 패키지에 포함되어 있으니, 해당 패키지를 받아야 `mongoimport`를 사용할 수 있다.
* 보다 자세한 내용은 <https://docs.mongodb.com/manual/reference/program/mongoimport/> 참

## 사용법&#x20;

* 자주 사용되는 매개변수 (Arguments)
  * `-d` (Unix), `/d` (Windows): 대상이 되는 데이터베이스의 이름 (즉, 어느 데이터베이스로 불러올 것인지)
  * `-c` (Unix), `/c` (Windows): 대상이 되는 콜렉션의 이름 (즉, 어느 콜렉션으로 불러올 것인지)
* 예시

```bash
$ mongoimport -d <데이터베이스> -c <콜렉션> <데이터 파일>
$ mongoimport -d test_database -c test_collection test.json
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://koonkim.gitbook.io/mongodb/appendix/utils/mongoimport.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
