use 명령어로 DB 생성 : use는 기존 db는 사용하고 없는 db는 새롭게 만든다. createCollection 명령어col 칼럼이 생성되었다. insert를 활용하여 데이터 입력과 동시에 생성
NonExistenPath: Data directory 가 발생했다.정상적으로 실행된다!
<홍길동과 임꺽정의 age가 변화하였다.>
예제 코드=> age가 23인 데이터 출력 : '임꺽정', '장길산'=> age가 0 이상이고 23이하인 데이터 출력 : '임꺽정', '장길산', '홍길동' => age가 19,20,21인 값 출력 홍길동 출력=> age가 23을 제외한 값 '홍길동', '일지매'=>
=> age가 0보다 크거나 같고 23보다 작은 데이터 출력 '홍길동' 출력db.col7.find({age: {$eq: 23}})=> age가 23인 데이터 출력 : '임꺽정', '장길산'db.col7.find({age: {$gte: 0}, $lte: 23})=> ag
db.col7.createIndex({name: 'text'})db.col7.createIndex({name : 'text', addr: 'text'}) => 여러개의 인덱스 생성db.col7.dropIndex('text')db.col7.dropIndexes() =>
\| \| \|=>likenum의 '2'번째 인덱스까지 출력
mongodb://localhost:27017아나콘다 프롬프트에서 pymongo 설치pip install pymongomongoDB연결 객체 생성mongoConnection = pymongo.MongoClient('mongodb://localhost:27017')데이터