python操作mongodb数据库

  

#!/usr/bin/python
# -*-coding:utf-8-*-

"""
@author: yugengde
@contact: yugengde@163.com
@file : delMongoDataBase.py
@time: 2017/11/14 14:23
"""

from pymongo import MongoClient

MONGODB_DB= 'tmall' # 指定数据库
MONGODB_DOC= 'tmall' # 指定要删除的文档


client = MongoClient(host='locahost',port=27017)
db = client[MONGODB_DB]

db.drop_collection(MONGODB_DOC)
posted @ 2017-11-14 14:30  人微言轻1  阅读(205)  评论(0编辑  收藏  举报