블로그 이미지
LifeisSimple

calendar

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

Notice

2011. 1. 10. 12:05 Brain Trainning/NoSQL
MongoDB에서 한글입력과 출력은 Java에서 가능하나 검색이 안되는 문제가 발생... 

윈도우는 malformed UTF-8 character sequence at offset 48 에러 발생

왜 그럴까 한참을 고민하다가 

UTF-8로 세팅 후 정상적으로 검색 가능.... 일단 문제는 해결 되었습니다. 

/etc/sysconfig/i18n 파일을 다음 내용으로 변경
/etc/bashrc 파일 끝부분에 다음 문자열 추가

콘솔 제접속 후 잘 설정되었는지 확인.

요렇게 나오면 잘 설정되었습니다.

그리고, mongod를 올리고 테스트 하면 정상적으로 입력/조회 가능합니다. 

앞으로 추가 체크해볼 사항으로는... 
1. 윈도우일 경우 
2. 소스 컴파일시 charset 지정 가능한지
입니다.
posted by LifeisSimple
2011. 1. 6. 13:38 Brain Trainning/NoSQL
아래처럼 MongoDB의 bin 폴더에 있는 mongo.exe 로 연결함.
그냥 mongo.exe를 실행하면 localhost의 MongoDB Server를 연결함.

PS C:\MongoDB\bin> .\mongo –host=192.168.80.38 –port=27017

MongoDB shell version: 1.6.5

Connecting to : 192.168.80.38:27017/test

> show collections

Department

Person

Pageview

System.indexes

Things


-- username // --password 는 덤... Help 에서 확인~

posted by LifeisSimple
2010. 12. 30. 15:16 Brain Trainning/NoSQL
최근버전이 1.6.5 입니다. (2010.12.30일 현재)

MongoDB Downloads

This table lists MongoDB distributions by platform and version. There are also packages available for various package managers.

OS X 32-bit
note
OS X 64-bit Linux 32-bit
note
Linux 64-bit Windows 32-bit
note
Windows 64-bit Solaris i86pc
note
Solaris 64 Source
Production Release (Recommended)
1.6.5
12/9/2010
Nightly
Previous Release(s)
1.4.5
8/31/2010
Development Release (Unstable)
1.7.4
12/21/2010
Nightly
Archived Releases
  • 32-bit builds are limited to around 2GB of data. See here for more information on the 32-bit limitation.

  • The MongoDB server (mongod) must run on a little-endian CPU, so if you are using a PPC OS X machine, mongod will not work.

  • The Linux legacy-static builds are only recommended for older systems. If you try to run and get a floating point exception, try a legacy-static build. Otherwise you should always use the regular builds.

  • See here for more information on MongoDB version numbers.

  • Included in each distribution are the MongoDB server, the MongoDB shell, backup and restore tools, import and export tools, and a GridFS tool.

  • See the MongoDB buildbot for details on ongoing builds and completion times

Drivers

Information on how to separately download or install the drivers and tools can be found on the Drivers page.

Language Packages Source API Reference
Python PyPI GitHub API
PHP PECL GitHub API
Ruby RubyGems GitHub API
Java jar GitHub API
C# packages GitHub
Perl cpan GitHub API
C++ source tarballs GitHub API

Source Code

Source code is available for MongoDB and all drivers.

Packages

MongoDB is included in several different package managers:

Documentation

The documentation is available for download as a PDF, generated nightly.

Powered by MongoDB Badges

We've made badges in brown, beige, blue and green for use on your sites that are powered by MongoDB. They are available below, and in multiple sizes here.

brown beige green blue
posted by LifeisSimple
2010. 12. 30. 15:12 Brain Trainning/NoSQL


뭔가 이해가 갈 듯 하면서도 약간은 어색하네요 흠... 

SQL to Mongo Mapping Chart

This page not done. Please help us finish it!

MySQL Program

Mongo Program

mysqld

mongod

mysql

mongo

MongoDB queries are expressed as JSON (BSON) objects.  This quick reference chart shows examples as both SQL and in Mongo Query Language syntax. 

The query expression in MongoDB (and other things, such as index key patterns) is represented as JSON.  However, the actual verb (e.g. "find") is done in one's regular programming language.  The exact forms of these verbs vary by language.  The examples below are Javascript and can be executed from the mongo shell.

SQL Statement

Mongo Query Language Statement

CREATE TABLE USERS (a Number, b Number)

implicit; can be done explicitly

INSERT INTO USERS VALUES(1,1)
db.users.insert({a:1,b:1})
SELECT a,b FROM users
db.users.find({}, {a:1,b:1})
SELECT * FROM users
db.users.find()
SELECT * FROM users WHERE age=33
db.users.find({age:33})
SELECT a,b FROM users WHERE age=33
db.users.find({age:33}, {a:1,b:1})
SELECT * FROM users WHERE age=33 ORDER BY name
db.users.find({age:33}).sort({name:1})
SELECT * FROM users WHERE age>33
db.users.find({'age':{$gt:33}})})
SELECT * FROM users WHERE age<33
db.users.find({'age':{$lt:33}})})
SELECT * FROM users WHERE age>33 AND age<=40
db.users.find({'age':{$gt:33,$lte:40}})})
SELECT * FROM users ORDER BY name DESC
db.users.find().sort({name:-1})
CREATE INDEX myindexname ON users(name)
db.users.ensureIndex({name:1})
SELECT * FROM users WHERE a=1 and b='q'
db.users.find({a:1,b:'q'})
SELECT * FROM users LIMIT 10 SKIP 20
db.users.find().limit(10).skip(20)
SELECT * FROM users WHERE a=1 or b=2
db.users.find( { $or : [ { a : 1 } , { b : 2 } ] } )
SELECT * FROM users LIMIT 1
db.users.findOne()
EXPLAIN SELECT * FROM users WHERE z=3
db.users.find({z:3}).explain()
SELECT DISTINCT last_name FROM users
db.users.distinct('last_name')
SELECT COUNT(*y)
FROM users
db.users.count()
SELECT COUNT(*y)
FROM users where AGE > 30
db.users.find({age: {'$gt': 30}}).count()
SELECT COUNT(AGE) from users
db.users.find({age: {'$exists': true}}).count()
UPDATE users SET a=1 WHERE b='q'
db.users.update({b:'q'}, {$set:{a:1}}, false, true)

The MongoDB Manual Pages are a good place to learn more.

 


posted by LifeisSimple
prev 1 next