일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- WebGL
- nodeJS
- openCV
- 데이터 과학
- 확률
- node.js
- R
- 김양재 목사
- 빅데이터
- 빅데이타
- probability
- c++
- Deep learning
- Big Data
- 김양재 목사님
- 통계
- Artificial Intelligence
- 인공지능
- Statistics
- 몽고디비
- 빅 데이터
- MongoDB
- No SQL
- 김양재
- 주일설교
- 우리들교회
- 빅 데이타
- Machine Learning
- 딥러닝
- data science
- Today
- Total
목록DB (7)
Scientific Computing & Data Science
MongoDB의 Database 및 Collection을 삭제하는 방법에 대해 알아보자.collection 삭제현재 db에 "users"라는 이름의 collection이 있다고 가정하자. > db.getCollectionNames() [ "system.indexes", "users" ] 현재 db에서 users collection을 삭제하는 명령은 drop이다. > db.users.drop() true > db.getCollectionNames() [ "system.indexes" ] drop 명령을 통해 collection이 삭제된 것을 확인할 수 있다.db 삭제먼저 "test"라는 이름의 db를 생성한다: > use test switched to db test > show dbs local 0.078..
by Geol Choi | March 24, 2014이번 글에서는 MongoDB를 시작하는 것에 대해 알아보도록 하겠다. 이전의 내용들을 이해하거나 실습을 통해 학습하였다면 이미 시작하는 방법을 알고있는 것이라 할 수 있지만 이번 글에서는 시작과 관련된 여러가지 옵션 또는 셋팅에 대해 좀 더 자세히 다룰 것이다. 커맨드라인에서 시작하기커맨드라인 툴(Mac OS: Terminal, Windows: cmd)에서 MongoDB를 시작할 때 "mongod"를 실행한다. 이 명령어 실행 시 자주 사용되는 옵션에 대하여 정리하였다. --dbpath데이터가 저장될 디렉터리를 지정한다. 만약 이 옵션이 생략되면 디폴트로 Linux에서는 "/dada/db", Windows에서는 "C:\data\db\"로 지정된다.mon..
by Geol Choi | March 10, 2014이번 글에서는 "데이터베이스 간 참조"에 대하여 알아보도록 하겠다. 도큐먼트를 참조하는 방법은 크게 두 가지가 있는데, 하나는 수동 참조(Manual Reference)이며 다른 하나는 "DBRef"를 사용하는 것이다.그러면 각각에 대하여 자세히 알아보자. 수동 참조수동 참조 방식은 참조할 다른 도큐먼트의 아이디(ObjectID)를 도큐먼트 내 하나의 키(key)로 저장하는 것이다. 즉, 키 값인 아이디를 통해 참조할 도큐먼트를 얻어내어 해당 도큐먼트의 다른 데이터를 얻는 방식이다. 이 방법은 간단한 방식으로 대부분의 경우에서 사용된다.'백문이 불여일견'이므로 예제(예제는 MongoDB의 공식문서를 참조하여 작성하였다)를 통해 자세히 설명하도록 하겠다...
by Geol Choi | March 6, 2014이번 글에서는 비교적 큰 사이즈의 바이너리 파일을 저장하는 메커니즘인 "GridFS"에 대해 알아보도록 하겠다.예를 들어, 블로그 같이 글을 작성하는 사이트를 만들어 DB와 연동할 경우 텍스트만이 아닌 이미지, 또는 특정 어플리케이션의 바이너리를 저장해야 할 것이다. MongoDB는 이러한 바이너리 파일을 효율적으로 관리하는 메커니즘을 제공하는데 이것이 GridFS이다. GridFS를 사용해서 파일을 저장해야 하는 이유를 들면 다음과 같다:GridFS는 MongoDB를 위해 설정한 "replication"이나 "autosharding"을 활용한다. 이는 패일오버(Failover) 및 스케일아웃(Scale-out)을 하는데 매우 쉽다. (Replicatio..
Written by cinema4d1. Add the following in "Environment Path / System Variables" on your system %MONGODB_HOME%/bin 2. Create "data\db" directory at any place you want, i.e. c:\mongdb\data\db. 3. Execute console using "cmd" command through "Windows key + R". 4. On your console type the following: mongod -dbpath [FULL PATH OF data/db] For instance, "mongod -dbpath c:\mongdb\data\db"
Written by cinema4dUpdate items using "$set" modifier : "$set" modifier adds item(s) if the relevant key exists or creates the key when absent. Type the following for data preparation: // drop the current database db.dropDatabase() // define webpage1 var user1 = {"username" : "gchoi", "age" : 37, "sex" : "male"} // insert items into DB db.users.insert(user1) db.users.find() Result: > db.users.fi..
Written by cinema4dSometimes you may want to modify only a certain portion of document. Using update modifiers you can do that by atomic level such as altering, adding or removing keys and even manipulating arrays and embedded documents. Assume that you have three webpages to manage and you are going to update pageviews - automatically increase by 1 when visiting. Type the following for data pre..