If value on property is 0, Neode assumes it is null.
See original GitHub issueI’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:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue has been resolved perfectly! Thanks! 😃
Checking it out now.