Nia.js a very simple tool for transfer MongoDB collection into Elasticsearch.
npm install nia.js
curl -XDELETE localhost:9200/*
import { Nia } from 'nia.js';
Nia(opts);
const opts = {
esOpts: {
esHost: 'localhost',
esPort: '9200',
log: 'error',
apiVersion: '7.2',
requestTimeout: 50000,
},
esIdx: '{by default collection_name}',
esType: '{by default collection_name}',
moColl: '{collection_name}',
moUrl: `mongodb://localhost:27017/{database_name}`,
pQueue: 250,
};