예상 완료 시간: 5분
Community에서 MongoDB Search 및 벡터 검색을 사용하려면 MongoDB Community 배포서버에 연결해야 합니다. 다음 방법을 사용하여 MongoDB Community 배포서버에 연결합니다.
MongoDB Shell은 MongoDB에 대한 대화형 명령줄 인터페이스입니다.
MongoDB Compass, MongoDB 데이터를 위한 GUI입니다.
MongoDB 운전자. 사용 가능한 모든 언어를 보려면 MongoDB 드라이버 설명서를 참조하세요.
이 페이지의 절차에 적용될 수 있는 경우 드롭다운 메뉴를 사용하여 인터페이스와 언어를 선택합니다.
전제 조건
시작하기 전에 다음 전제 조건이 있어야 합니다.
MongoDB Community and MongoDB Search Community
참고
mongod및mongot프로세스가 모두 실행 중인지 확인합니다.연결할 유효한 사용자 이름 과 비밀번호
복제본 세트 에서 사용자를 아직 생성하지 않은 경우 터미널에서 다음 명령을 실행 사용자를 생성합니다.
mongosh를 사용하여 복제본 세트 에 연결합니다.mongosh Run the following commands to create a
mongotUseruser in theadmindatabase with thesearchCoordinatorrole. MongoDB uses themongotUseruser to authenticatemongotwithmongod.use admin db.createUser( { user: "mongotUser", pwd: passwordPrompt(), roles: [ { role: "searchCoordinator", db: "admin" } ] } ) Users with the
searchCoordinatorrole havereadAnyDatabaseprivileges and write permissions on the__mdb_internal_searchdatabase.중요
__mdb_internal_search데이터베이스 의 내용을 수정하지 마세요.
복제본 세트 의 연결 문자열 에는 모든 멤버 노드가 포함됩니다. 따라서 연결하려면 복제본 세트 이름과 모든 복제본 세트 멤버의 호스트 이름 또는 IP 주소 및 포트가 필요합니다.
복제본 세트에 연결
Use your replica set's connection string to connect to your replica set with your preferred client. To ensure that you configured mongot and mongod correctly, you can run a command that retrieves search indexes.
다음 단계
Now that you've connected to your replica set, proceed to Query with MongoDB Search and Vector Search in Community.