Exemple #1
0
def insert_mongodb():
    connect('backoffice')
    for i in range(10**7):
        device = generate_device()
        device.save()
Exemple #2
0
def insert_elasticsearch():
    es = Elasticsearch()
    for i in range(10**7):
        device = generate_device().to_json()
        es.index(index="backoffice", doc_type="device", id=i, body=device)