import methods
from pymongo import MongoClient
from rnpp.utils.etc.parameters import params_data, args_data

# database
client = MongoClient()
db = client['test-database']
collection = db['data-collection']
# collection.remove({})

input_data, support, f = methods.generate_train_data(args_data)
doc = {'label': 'test', 'params': params_data,
       'data': {'arrivals': input_data.tolist(), 'support': support.tolist(), 'f': f.tolist()}}
collection.update({"params": params_data}, doc, upsert=True)
print collection.find({"params": params_data}).count()
