react-awesome-query-builder icon indicating copy to clipboard operation
react-awesome-query-builder copied to clipboard

Querying a Javascript Object

Open shawnmclean opened this issue 3 years ago • 1 comments

I am looking to do some form of filter on an object:

const data = [{
  name: 'Test',
  address: {
    country: 'JM'
  }
}]

const exists = someLib.filter('sql | JsonLogic | etc', data);

This library does the work for editing the query but I can't seem to find a good library that can run the query on the client-side. JsonLogic could work but I'd like to use some form of expression if possible.

Does anyone know what I'm looking for here and any suggestions?

image

Is there anything that can execute MongoDB, SQL or querystring here against a local javascript object in the browser?

shawnmclean avatar Jan 07 '22 17:01 shawnmclean

JsonLogic could work but I'd like to use some form of expression if possible.

JsonLogic is a good way to run query generated by RAQB on client-side. If you prefer expression string instead of object, you can try SpEL which is supported in RAQB 5.0 See https://github.com/benmarch/spel2js

ukrbublik avatar Feb 10 '22 15:02 ukrbublik