question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@eq helper doesn't work when accessing an object at a deeper level

See original GitHub issue

Given this context: {"attr":{"ct1":{"value":["Mick"]}}}

This code

 {#attr}
        {#ct1}
           {@eq key=value value="Mick"}
              It should be true
          {:else}
              But it's false
          {/eq}
        {/ct1}
    {/attr}

should return True. But it returns False for some reason.

Same thing for this variant:

 {@eq key=attr.ct1.value value="Mick"}
              It should be true
          {:else}
              But it's false
          {/eq}

The weird thing is, that if you change it to @gte instead of @eq, it returns True correctly. So the problem seems to only happen with @eq. Am I missing something or is it a bug?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
rashad612commented, Mar 6, 2018

@fpreti, how about this?

{#user}
{@eq key="GRUPPO" value="STEP2"}{/eq}
{/user}
1reaction
rashad612commented, Nov 16, 2017

In your ctx value is an array. You’re trying to compare the values between a string and an array. Your ctx should be something like this:

{"attr":{"ct1":{"value":"Mick"}}}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing nested JavaScript objects and arrays by string path
I just made this based on some similar code I already had, it appears to work: Object.byString = function(o, s) { s =...
Read more >
nil pointer evaluating interface when upper level doesn't exist ...
I was using open source helm chart which was gigantic. I cant fix this right now to have flat tree values. This issue...
Read more >
How to equalize: Fine-tune your listening experience
Audio engineers know how to equalize (EQ), so the music will sound just fine in most scenarios. While not all playback systems are...
Read more >
Hashing and Equality in Python - Lyft Engineering
Let's first dive into how objects work if we don't implement __hash__ and __eq__ . By default, equality and hashes are based on...
Read more >
Back to Basics: Understanding PowerShell Objects
Learn some key concepts when it comes to objects in PowerShell and apply to your own scripting through coding and visualizations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found