• 회원가입
  • 로그인
  • 구글아이디로 로그인

[mongodb] Python - MongoDB Drop Collection (컬렉션 삭제)

3067  
목차
  1. drop() 메서드 - collection 삭제

 

drop() 메서드 - collection 삭제

 

collection 객체의 drop() 메서드 이용.

※ collection 삭제 성공 시, True 반환.

※ collection 삭제 실패 시, False 반환.

 


[예제]

 

import pymongo 


myclient = pymongo.MongoClient('mongodb://localhost:27017/')

mydb = myclient['hz']

mycol = mydb["hz_member"]

mycol.drop()

 

 


분류 제목
mongodb Python - MongoDB start (설치・연결)
mongodb Python - MongoDB Create Database (DB 생성)
mongodb Python - MongoDB Create Collection (컬렉션 생성)
mongodb Python - MongoDB Insert (데이터 삽입)
mongodb Python - MongoDB Find (데이터 찾기)
mongodb Python - MongoDB Query (검색 쿼리)
mongodb Python - MongoDB Sort (데이터 정렬)
mongodb Python - MongoDB Delete (데이터 삭제)
mongodb Python - MongoDB Drop Collection (컬렉션 삭제)
mongodb Python - MongoDB Update (데이터 수정)
mongodb Python - MongoDB Limit (데이터 출력개수)
목록
찾아주셔서 감사합니다. Since 2012