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.

If value on property is 0, Neode assumes it is null.

See original GitHub issue

I’m trying to set a property on a relationship which measures distance. Funnily enough, some of the distances are 0 - i.e., a user willing to travel to his own home has to travel 0 miles to get there.

All works well except when a zero value is entered here, in which case it is stored correctly in the database, but it’s NOT returned correctly from the neode OGM.

Here’s an example:

const set = async (someNumber, nodeA, nodeB) => {
    return await nodeA.relateTo(nodeB, "someRelationship", {
        someProperty: someNumber
      });
}

This works fine unless someNumber === 0;

let ten = await set(10, nodeA, nodeB);
console.log(ten.get('someProperty')) // -> 10
let zero = await set(0, nodeA, nodeB);
console.log(zero.get('someProperty')) // -> null

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kerryboykocommented, Jan 1, 2018

The issue has been resolved perfectly! Thanks! 😃

0reactions
kerryboykocommented, Jan 1, 2018

Checking it out now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I check for null values in JavaScript? - Stack Overflow
JavaScript is very flexible with regards to checking for "null" values. ... 0) -- or -- if (isNaN(variable)) - variable = ''; (false)...
Read more >
null - JavaScript - MDN Web Docs - Mozilla
The null value represents the intentional absence of any object value. It is one of JavaScript's primitive values and is treated as falsy...
Read more >
Understanding non-existent properties and working with nulls
A map with an entry with a null value, as above, is different than a map that is missing the entry. This differentiation...
Read more >
How to Fix TypeError: Null is Not an Object in JavaScript
The JavaScript error TypeError: null is not an object occurs when a property is accessed or a method is called on a null...
Read more >
S.3.2 Hypothesis Testing (P-Value Approach) - STAT ONLINE
The P-value approach involves determining "likely" or "unlikely" by determining the probability — assuming the null hypothesis were true — of observing a ......
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