MongoDB to Elasticsearch. Through this you can import data from mongoDB to elasticsearch.
Project description
mongoDB to elasticsearch
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
If you like the project, support by star
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for mongoelastic-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0379ed81af619530bd969a1f8b9adaf7c2a412790f431ebb6e27910bf90af21 |
|
MD5 | 8672ac4e89677c1b2481c7cd35e584ef |
|
BLAKE2b-256 | 7d51da3b6f952bb504038572d7fc5821b9f75c6322eadaa852664e77c02bc3b5 |