Python

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

3069
목차
  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()

 

 


분류 제목
basic Python - PIP (피프) - 패키지(모듈) 관리자
basic Python - Try...Except - 에러 테스트/제어. (= 트라이...익세프트)
basic Python - User Input (사용자 입력)
basic Python - String Format (문자열 포맷)
file Python - File Open - 파일열기
file Python - File Read - 파일읽기
file Python - File Write - 파일쓰기
file Python - Delete File (파일삭제)
mysql Python - MySQL Start (DB 사용)
mysql Python - MySQL Create Database (DB 생성)
mysql Python - MySQL Create Table (테이블 생성)
mysql Python - MySQL Insert Into Table (데이터 삽입)
mysql Python - MySQL Select From (데이터 선택)
mysql Python - MySQL Where (조건절)
mysql Python - MySQL Order By (정렬순서)
3/32
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티 2
웹유틸
회원센터
홈짱닷컴 PC버전 로그인