Passing JavaScript Object to ElasticSearch query

Solved: you can just pass a JavaScript object. Not sure what my mistake was but it's working now.

Hi Everyone,

Can't figure out how to pass real-time data with JavaScript objects to ElasticSearch query.

I run NodeJS with Elastic. I have an ElasticSearch document with a product and a price. Now I want to see the profit in real-time. I store the real-time prices in a JavaScript object. I want to send the JS object as a param in the scripted_metric scripts.

Is this possible? Simple values like numbers work fine.

The JS Object looks like this:
{ 'productName': {
'price': 5
'anotherProductName': {
'price': 4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.