How to PUT data onto an elasticsearch datastore nodejs - node.js

I've just built out my first elasticsearch datastore using the documentation and that was great. I've also set myself up a lambda to make PUT and GET calls to the elasticsearch datastore but having read multiple resources, I'm still unclear as to how to to connect my lambda up to the elasticsearch to PUT data onto it.

Related

Configuring multiple clients in Redis with Node.js

Working on Redis Cache in a Node JS application and trying to have individual clients for read and write operations in Redis.
When using replicas, the main node is handling both Write and read and the other replica nodes are responsible for only reading by default. when using the primary endpoint, we could see the traffic is not equally shared among the nodes so would like to configure both the read and write node clients in the application for making the nodes work better.
Now I am having two nodes in Redis where one is responsible for read and the other is for write operations. I was trying to get if there is any configuration in createClient method where we can pass the read and write endpoint and When searching for the configurations I am not able to get any properties to pass in the createClient method.
Could anyone share, Is there any such configuration like that to specify to the Redis client to use read and write with different endpoint configurations when creating or we can achieve the same with any approaches?
Using Redis (node-redis) package from npm.
As of now trying to get any such configurations but not getting any proper way of handling the configurations. Most of them suggesting to go with manual checks for the commands and choosing the endpoint.

Sync My Data From My MongoDB database to Elastic Search NodeJs

I have my data on MongoDB atlas and want the data from my atlas to sync to my elastic search server so that I can get all my data up for a quick search with an elastic search and NodeJs. How do I go about this?
NB: I know that using the NodeJs package, mongoosastic, you can sync that data coming from a request between the database and the elastic search.
The confusion is that if I quit my server and bring it up again, how will all my data sync to elastic search for a proper search?

Serverless and Express.Js

I want to create a lambda function that will be triggered upon a kinesis Record and store data in the MongoDB database. Data will be added to the kinesis stream through a REST API that uses the same MongoDB database mentioned above. So, can I implement that idea according to the following folder structure? If not what is the best method to do it?

Can we sync data from MongoDB to Elasticsearch in realtime in NodeJS?

I am dividing the load on my Database and want to retrieve data from ES and write data to MongoDB. Can I sync them real time? I have checked the Transporter library but I want to do it for realtime.
There are several ways to achieve that :
Using your own application server. Whenever you are inserting a new
document in the mongo, put it in the ES as well at the same time.
That way you will maintain the consistency with minimum latency.
Use logstash. It has near realtime pipelining capabilities.
You can use elasticsearch mongodb river. Its a plugin used for data synchronization between mongo and elasticsearch.

Difference between rethinkdb query and API results

I am having a problem with retrieving values from my rethinkdb database and exposing them in my API.
Everything is running without errors, but I get different results when querying the database with python then the API.
I have created the database, tables and inserted data with REPL queries in python.
My setup is like this:
- AWS ec2 (Ubuntu)
- Rethinkdb as database
- Node API: clone of https://github.com/yoonic/atlas
I have no clue why there is a difference or where to look next for debugging.
Any help to get me going is appreciated!

Resources