Skip to content

MongoDB User Guide Eng

suhyunjeon edited this page Sep 28, 2013 · 11 revisions

Tadpole DB HUB(MongoDB) User Guide

Date : 17 Aug 2013 Written : HyunJong Cho([email protected])

Welcome to Tadpole! This is a web-based DB Query tool. You can connect variety DB in web browser and can control function for each users(user or admin or dba and so on). The goal is a DB HUB for all DB.

Now we are supporting - Amazon RDS, CUBRID, MarisDB, Oracle, MySQL, MSSQL, PostgreSQL, SQLite, MongoDB. Tadpole lets you creatively focus on your project by simply the amount of work needed for a given task.

List of tested

  • Amazon RDS : aws-java-sdk-1.4.7
  • CUBRID : 8.4.x ~
  • Oracle : 10g ~
  • MySQL : 5.4.x ~
  • MariaDB : 5.5.x ~
  • MSSQL : 2000 ~
  • PostgreSQL : 9.1.x ~
  • SQLite : 3.7.2 ~
  • MongoDB : 2.0.5 ~

Documentation

This is explain for MongoDB

Agenda

Install

  1. JAVA 1.6.x(Mac 1.7.x)
  2. Linux, Mac, Windows, Tomcat 6.x (If you want to user the other O.S, connect me : [email protected])
  3. Download : https://code.google.com/p/tadpole-for-db-tools/downloads/list
  4. Reference more : https://github.com/hangum/TadpoleForDBTools/issues?direction=desc&sort=created&state=open

Getting Started

Standalone installation

  1. Execute TadpoleDBHub-1.x.x\tadpole-standalone.exe
  2. After install, automatically run a web-browser(OR you can install the TadpoleForDBToolsStartup by double click). It will happen to you when you first start that you can't find the page to the web-browser cause engine is starting. Don't freak out. Let's click F5(Refresh)button.
  3. Open the web-browser and start 'http://127.0.0.1:10081/tadpole' ps) Tadpole DB is TadpoleDBHub-1.x.x/configuration/tadpole/db/tadpole-system.db. Please install new version and backup.

Install Tomcat

  1. Did you have installed Tadpole before? OK. Please backup a apache-tomcat-6.x.x/work/Catalina/localhost/tadpole/eclipse/configuration/tadpole/db/tadpole-system.db file. And delete apache-tomcat-6.x.x/work directory.
  2. Change war name to tadpole.war from TadpoleDBHub1.x.x-tadpole.war.
  3. The WAR file should be in the webapp directory path. And Tomcat should be installed and running.
  4. If the context root is tadpole, start http://127.0.0.1:8080/tadpole/tadpole in the web-browser.
  5. If you upgrade to data of old data, copy to tadpole-system.db from a backup file(number1. apache-tomcat-6.x.x/work/Catalina/localhost/tadpole/eclipse/configuration/tadpole/db/tadpole-system.db) in same directory.

Login

Login

  1. Test mode window.
  2. Tadpole has Admin, Manager, User(Developer). First DEFAULT USER made.
  1. If you want to try test mode, you don't need to EMAIL ADDRESS, PASSWORD. We supported 'admin login/user login' for test mode.
  2. Add new user : ((https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%EC%8B%A0%EA%B7%9C-%EC%9C%A0%EC%A0%80-%EB%93%B1%EB%A1%9D)

권한

  1. 어드민은 시스템에 등록된 모든 디비(패스워드 제외)와 사용자를 관리 합니다.
  2. 관리자는 사용자 그룹을 관리 합니다. 사용자들과 DB, 리소스등을 공유하며 함께 사용 합니다. 처음 관리자를 만드실때는 프로젝트 그룹 처음등록시 어드민의 허락이 필요합니다. DB를 등록 삭제 할 수 있습니다. 사용자는 디비를 등록 할 수 없습니다.
  3. DBA는 사용자 리스트와 디비를 볼 수 있으며, 사용자가 실행한 쿼리를 관리할 수 있습니다.
  4. 사용자는 실제 사용자 입니다. 사용자는 특정 그룹에 소속 되어야 하며 관리자의 승인 후 로그인 가능합니다. 관리자가 등록해 놓은 디비를 사용할 수 있으며, 쿼리등을 다른 사용자와 공유할 수 있습니다.

The whole view of Tadpole

Tadpole part

  1. Toolbar : Connection DB, save, authority(if it is a 'manager' or an 'admin' user), environment and so on.
  2. Database List : New create DB, delete, shared user's data.
  3. Object Explorer : Show the Object(Table, View)' list of selected to the Database List.
  4. Main UI : Show the DB Query editor, MongoDB profile viewer and main job viewer.

Toolbar

A toolbar is a GUI widget on which on-screen buttons, icons, menu, or other input or output elements are placed. And limited permission. 'Manager' can use all function, 'User' can't create DB, delete, profile functions.

toolbar

  • Show connection DB window.
  • Save data in current SQL Editor.
  • Show SQL Editor selected 'Database List' window.
  • Show ERD Editor selected 'Database List' window.
  • Delete shared resources selected 'Database List' window.
  • Show user, db information.
  • Show history information all DB.
  • Show environment information.
  • Show bug, request issues.(need to Github account)
  • Show system preferences.
  • Close button.(If standalone, program shutdown, or run Tomcat, logout)

Database List

Display DB list which do allow the connections. Use shared connection information to user in same groups.

Add DB and Use

Only Manager permission user can add DB.

Add DB : Toolbar connection-toolbar-btn click.

connection dialog

  1. DB List for connection
  2. System preference to management Tadpole
  • Server type : Input DB of server type
  • Server type -> Production Server : You are able to add a new admin user directly to the database. IF generate user can't delete Collection in admin DB.
  • Server type -> Developer Server : This is development DB and you can do all thing for except permission.
  • Server type -> Others Server : This is add other uses of a DB and you can do all thing for except permission.
  • Group : DB group to add connection information. If you want to manage group by DB, it is a good tip. And you can use group name by your job name or purpose of a database.
  • Name : DB name for Database List.
  1. Input database information selected no.1.
  2. Additional information connected no.2.
  • Readonly Connection : Can't delete, update and so on connected DB. Only SELECT statements is possible in SQL Editor.
  • Table Filters : The filter is hidden and shown in the 'Object Explore'.
  • Show Tables : Setup display table list of 'Object Explore'. When tables are more than 1000, it is good tip.
  1. Test, Save, Cancel to saved DB.
  • Test Connection : Display the information, when it is possible for a connection to input information of no.2.
  • Confirm : Add DB.
  • Cancel : Cancel add DB.

Connected DB

If you add DB in the 'Database List', display in the group.

connection-2

  1. Display 'DB icon [D] add name (account information)'. DB name tag
  • First : DB list
  • [D] : acronym of Developer Server. Production Server is [P], Others Server is [O].
  • Added name.
  • Added account DB information. (Normal user can't see).
  1. If you select DB, display Object(For example, selected Collections of DB, Indexes, JavaScript) to 'Object explore'.
  2. If you double-click DB, open instance information of DB, summary Collection, DB rock, a replica set, sharding information.
  3. If it is a SELECT DB after, right-click on this mouse, display action for execute as user permission.
  • Refresh : Search again from the 'Database List' for the newest.
  • Web console : open MongoDB WebConsole.
  • Server Status : Displaying DB process user info dialog.
  • GridFS : Displaying dialog of result by GridFS.
  • Top : Open DB used information dialog.
  • ERD -> All Table ERD : Displaying relationship by referential integrity.
  • ERD -> Create ERD : Displaying window to draw ERD, drag and drop tables to 'Object Explore'.
  • Administer -> Profile : Displaying executed SQL query information in DB.
  • Administer -> User management : Open dialog DB user management.
  • Administer -> DB Information : Displaying Object(For examplem, selectted Collections of DB, Indexes, JavaScript) in 'Object Explore'.
  • Administer -> Session List : Displaying Session list running DB.
  • Administer -> Import : Get data to MongoDB connected DB in tadpole db hub.
  • Administer -> Delete Database : Remove DB. Notice! DROP database drops all tables in the database and deletes the database and connected DB information.

Object Explorer

If database selected in the 'Database List', displaying Collections, Indexes, JavaScript.

mongo object

Filter : Search Collection.

  • Double click Table name -> display select query in SQL Editor.
  • Display comments on table name Table to mouseover event.
  1. If you selected Collection, displaying field information of Collection.
  2. If you double click Collection, displaying selected Collection window.
  3. If you select Collection, and right-clicking, displaying popup menu.
  • Create Collection : Create the Collection.
  • Drop Collection : Drop the Collection.
  • Refresh Collection : Refresh from the current window for the newest.
  • Generate Statement : Collection : Add new row in Collection.
  • Rename Collection : Modifry Collection name.
  • ReIndex Collection : Reindex in Connection. Caution! If Collection had many data, think again.

Database Information Editor

Displaying connected MongoDB of all Connection information. You can see this editor to Connection Manager by double click db.

mongodb all connection

  • Name Filter : Collection 이름을 기준으로 필터링 합니다.
  • Collection을 선택하면 해당 Collection의 field정보가 출력됩니다.
  • Collection을 더블 클릭하면 해당 Collection을 검색하는 창으로 이동합니다.
  • 하단에는 DB의 summary정보가 출력됩니다.

Find Collection

Collection 정보를 검색합니다. 기본적으로 JSON 으로 검색 할 수 있는 창이 존재합니다. 기본적인 검색 결과를 Tree, Table형태로 보여줍니다. 에디터에서 Ctrl + Space를 누르면 Field정보가 표시 됩니다.

mongodb find collection

  1. Collection 검색 창
  • 조건은 다음과 같이 입력합니다. op field 가 query인 항목을 검색한다고 하면 다음과 같습니다. {op : 'query'}
  • Find : 검색 정보를 입력 합니다 예를 들어 위의 캡쳐화면에서는 item_id가 7인 정보를 검색하는 예제입니다.
  • Field : 위의 캡쳐화면에서 검색 결과 필드를 quantity를 보여줍니다. 만약에 모든 Field를 보여주려면 입력하지 않습니다.
  • Sort : 위의 캡쳐화면에서 필드 quantity를 내림차순으로 검색합니다.
  • Skip : 검색 결과 중에 Skip합니다.
  • Limit : 검색 결과 중의 조건을 100건 만 표시합니다.
  1. 쿼리 플랜 : 검색 조건의 query explain 정보를 다이얼로그 화면을 오픈합니다.
  • 서버 메시지 : 검색 중에 서버에서 발생한 메시지 다이얼로그 화면을 오픈합니다.
  • 검색 : 검색을 시작합니다.
  1. 검색 결과를 출력합니다.
  • Tree View : 검색 결과를 Tree 형태로 출력합니다. Value클릭하여 값을 수정 할수 있습니다. 결과를 더블클릭하면 JSON형식으로 표시됩니다.
  • Table View : 검색 결과를 Table 형태로 출력합니다. 결과를 더블클릭하면 TREE형식으로 표시됩니다.
  • Tadpole Message : 검색 실패시 정보를 출력합니다.
  1. 검색 결과에 따른 명령을 수행합니다.

GridFS 기능

GridFS은 몽고디비에서 파일을 올리거나 내릴 수 있습니다.

mongodb  gridfs

  1. bucket : 검색 할 bucket 이름
  2. File Name : 검색 할 파일 이름
  3. Skip : 검색 결과 skip 수
  4. Limit : 검색 결과 Limit 수
  5. Search Button : 검색 결과
  6. Insert Button : 입력 다이얼로그
  7. Delete Button : file 선택 후 삭제 버튼
  8. Download Button : file download

Insert 버튼을 클릭하면 다음과 같은 화면이 오픈 됩니다.

gridfa insert

  1. Bucket Name : 저장 할 bucket 이름을 입력합니다.
  2. Select File 버튼 : 업로드 할 파일을 선택합니다.
  3. Upload 버튼 : Select File에서 선택한 파일을 업로드 합니다.
  4. OK 버튼 : 저장 합니다.

Profiling

몽고디비는 실행한 질의를 프로파일 하는 기능이 있습니다.

profiling

  1. Start Profiling 버튼 : 몽고디비의 프로파일을 한번도 수행하지 않았다면 클릭하여 쿼리의 프로파일을 시작합니다.
  2. Stop Profiling 버튼 : 몽고디비의 프로파일을 중지합니다.
  3. Remove Profile Data 버튼 : 프로파일 데이터를 삭제합니다.
  4. Display 텍스트 : 화면 갱신 주기
  5. Great then(millis) 텍스트 : 쿼리 수행 속도
  6. Limit 텍스트 : 쿼리 검색 결과 한도
  7. Start Refresh : Great then, limit 조건으로 검색을 시작합니다.
  8. Stop Refresh : 검색을 중지합니다.

Query가 있는 검색 조건의 경우 쿼리를 튜닝 할 수 있습니다. 튜닝이 필요한 행을 더블 클릭하거나, Show Detail 버튼을 클릭하면 튜닝 화면이 오픈 됩니다.

query tuning

ERD

몽고디비의 컬랙션 정보를 읽어서 다이어그램 형태로 보여집니다. Connection Manager에서 All Table ERD를 클릭하면, 디비의 모든 Collection 를 diagram으로 표현 합니다. Create ERD Diagram을 클릭하면 Object Explorer에서 사용자가 원하는 Collection만 출력 할 수 있습니다.

mongodb erd

Import

올챙이에 연결된 디비의 데이터를 몽고디비로 Import하는 기능입니다. 테이블의 전체 혹은 쿼리를 입력하여 몽고디비에 데이터를 import합니다.

테이블 데이터는 가져올 때는 RDB의 테이블 명을 몽고디비 에서는 Collection 명으로 가져옵니다.

import-table

쿼리 정보를 이용하여 데이터를 임포트 합니다

import-query

Session List

  • MariaDB, MySQL can see Session List. session-list

Session List is displayed Session list executed in the DB. And you can close Long time to execute or shutdown query.

  1. Collection shortcuts of Session List.
  2. Display current SQL statements.
  3. If you select query of number ②, display SQL statements executed query.

User Management

User list of group, manage db list and add a user, change stop use. Or select executed query list of user, but only administrator and DBA can be use.

UserManagement

Display all user list, if you double-click user, displaying 'Executed SQL Management'. This is executed previously is executed again on the viewer.