-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrop.py
More file actions
20 lines (16 loc) · 754 Bytes
/
drop.py
File metadata and controls
20 lines (16 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright (c) 2012 Stellenbosch University, 2012
# This source code is released under the Academic Free License 3.0
# See https://github.com/gvrooyen/SocialLearning/blob/master/LICENSE for the full text of the license.
# Author: G-J van Rooyen <gvrooyen@sun.ac.za>
"""
Drop a collection from the local SocialLearning MongoDB database.
This script is intended to be run from the command line.
"""
import pymongo
import argparse
parser = argparse.ArgumentParser(description="Drop a collection from the local SocialLearning database")
parser.add_argument('deme', type=str, default='default', help="The name of the genetic programming deme")
args = parser.parse_args()
conn = pymongo.Connection()
db = conn.SocialLearning
db.drop_collection(args.deme)