Questions tagged [jsonlogic]

11 questions
2
votes
0 answers

How to write jsonlogic.js rule that test an object against all objects in array (some)?

I have data for jsonlogic rule: { "component": { "tableNumber": 102}, "refcomponents": [ { "tableNumber": 102}, {"tableNumber": 302} ] } and i need to check if component's tableNumber is found in refcomponents array. Can this be done? If not what…
char m
  • 7,840
  • 14
  • 68
  • 117
1
vote
1 answer

Working with Json Logic on Pandas Dataframe

How can I use a manual logic for feature aggregation for example bu using Json Logic (open to other solutions as well) on large dataframes: For example if I have this dataframe (in reality it's a large DF): pie_df temp pie_filling 0 100…
Noa Yehezkel
  • 468
  • 2
  • 4
  • 20
0
votes
1 answer

Extract an element inside an array that is inside a json object using jsonlogic

I have the following JSON { "transactionId" : "123456789", "amount" : 215, "refunds" : { "detail" : [ { "id" : 12345, "amount" : 7 }, { "id" : 67890, …
Alejandro Herrera
  • 411
  • 1
  • 5
  • 22
0
votes
0 answers

send jsonlogic through grpc

everyone, I need to send jsonlogic object through gRPC, so I cannot understand how to build a message that can contain property with dynamic keys, and dynamic types of that keys value. message JSONLogic { string somePropperty = 1; ???…
0
votes
0 answers

Same object does (not) pass typescript typechecks depending on the way it is declared

I'm playing around with JsonLogic and more precisely json-logic-js. I have a very basic nodejs project with typescript setup. When I now enter seemingly the same code, one version passes compilation, the other one throws an error. The code is taken…
tommueller
  • 2,358
  • 2
  • 32
  • 44
0
votes
1 answer

Convert simple expressions into JsonLogic format

Using python, I need to convert expressions into JsonLogic format. Expressions such as Boolean expressions, if else / ternary expressions, etc. Any suggestions how to achieve this ? P.S. I see that we have a js-to-json-logic library for the same in…
user
  • 383
  • 1
  • 5
  • 20
0
votes
1 answer

Operator "missing" not working properly in JsonLogic

I am using JsonLogic to validate my input payload with the rules defined using JsonLogic. I am able to test the rules using "Play with it" tool and my rules work perfectly fine against my input data. But when I run the same rules through my .net…
WAQ
  • 2,556
  • 6
  • 45
  • 86
0
votes
1 answer

How to import jsonLogic into a Svelte component

What is the syntax to import and use jsonLogic within Svelte?
w. Patrick Gale
  • 1,643
  • 13
  • 22
0
votes
1 answer

Why am I getting a "Cannot find module 'jsonLogic'" error?

I've installed JsonLogic using Yarn. yarn add json-logic-js When I attempt to implement a simple example: import jsonLogic from 'jsonLogic'; jsonLogic.apply({ '==': [1, 1] }); I get the following error: Cannot find module 'jsonLogic' Why can't…
Ryan Payne
  • 5,249
  • 4
  • 28
  • 69
-1
votes
1 answer

Can't correctly type JSON logic with a dynamic operator

I'm using the definitely typed package for json-logic-js. I can't seem to get TypeScript to compile when I'm using a dynamic operator, but it works fine if I use a static one. This works: const staticRule: RulesLogic = { '==':…
Adam Jenkins
  • 51,445
  • 11
  • 72
  • 100
-1
votes
1 answer

Grouping and Aggregating data based on List of dynamic JSON Fields in C#

I have a JSONArray which contains multiple JSONObjects and each JSON object represents a row of data. (Like a SQL row) JSON Example(JSON is dynamic) [{ "col1": "a1", "col2": "b1", "col3": 10 }, { "col1": "a1", "col2": "b1", "col3": 11 }, { "col1":…
Chethan SR
  • 77
  • 1
  • 9