You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we stumbled today over a Problem. We want to "delete" a LocalDate value from a Document.
According to the NoSQL-Example it should be possible, to do this by writing an null into the LocalDate-Property of the model.
But if look into the Database the DateTime-Value in the Document is still set to the old value and not to "".
So I believe this happens in the org.openntf.xsp.nosql.driver.lsxbe/src/org/openntf/xsp/nosql/communication/driver/lsxbe/util/DominoNoSQLUtil.toDominoFriendly-Method. The null value from the property gets to the else method at the bottom and fails on the null.toString() method.
Would it help to add at the bottom an additional else if for handling null values?
} else if(value instanceof TemporalAccessor) {
Instant inst = Instant.from((TemporalAccessor)value);
DateTime dt = session.createDateTime(Date.from(inst));
return dt;
} else if (value == null) {
return null;
} else {
// TODO support other types above
return value.toString();
}
In my simple test in a java-agent it wrote the correct "" into the Item.
best regards
Harald
The text was updated successfully, but these errors were encountered:
frocentus
changed the title
NoSQL - write Null to Fields
NoSQL - write Null to (DateTime-)Fields
Sep 13, 2023
Ah, so I see. My guess is that it probably skips over any null values in the incoming object, which it shouldn't. I'll look into changing it to remove items that are in the entity object but not in the incoming payload.
Hello Jesse,
we stumbled today over a Problem. We want to "delete" a
LocalDate
value from a Document.According to the NoSQL-Example it should be possible, to do this by writing an
null
into theLocalDate
-Property of the model.But if look into the Database the
DateTime
-Value in the Document is still set to the old value and not to "".So I believe this happens in the
org.openntf.xsp.nosql.driver.lsxbe/src/org/openntf/xsp/nosql/communication/driver/lsxbe/util/DominoNoSQLUtil.toDominoFriendly
-Method. Thenull
value from the property gets to theelse
method at the bottom and fails on thenull.toString()
method.Would it help to add at the bottom an additional
else if
for handlingnull
values?In my simple test in a java-agent it wrote the correct "" into the Item.
best regards
Harald
The text was updated successfully, but these errors were encountered: