Skip to main content

MongoDB to Elasticsearch. Through this you can import data from mongoDB to elasticsearch.

Project description

mongoDB to elasticsearch

PyPI

mongoelastic stands for MongoDB to Elasticsearch. Through this you can import data from mongoDB to elasticsearch.


Installation

Install mongoelastic from PyPI:

pip install mongoelastic

Usage

  • Here is the sample code
from mongoelastic.mongoelastic import MongoElastic
from elasticsearch import Elasticsearch


es_connection_object = Elasticsearch(['localhost'],use_ssl=False)

config = {
    'mongo_host': 'YOUR_MONGO_HOST',
    'mongo_port': YOUR_MONGO_PORT,
    'mongo_db_name': 'YOUR_MONGO_DB_NAME',
    'mongo_document_name': 'YOUR_MONGO_DOCUMENT_NAME',
    'es_connection': es_connection_object
    'es_index_name':'TEST_INDEX'
    'es_doc_type':'test_doc_type'
}
obb = MongoElastic(config)
obb.start()


# You can also filter query MongoDB like:
m_filter = {'mongo_condition':{"_id" : "5d9740bc245fb21097e82c11"}}
obb.start(m_filter)  

License

Licence

If you like the project, support by star

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mongoelastic-0.0.9.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

mongoelastic-0.0.9-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page