Replies: 1 comment 10 replies
-
Handling non-existing fields is explained with more details in our docs here and here. Your 3rd and 4th query could look like this to achieve the desired result var query3 = session.Advanced.DocumentQuery<TestDoc>().WhereExists("IsLocked");
var query3Result = query3.ToList();
Assert.Equal(0, query3Result.Count);
var query4 = session.Advanced.DocumentQuery<TestDoc>().Not.WhereExists("IsLocked");
var query4Result = query4.ToList();
Assert.Equal(5, query4Result.Count); |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When querying for a nullable field, it is possible to query for e.g
"[NullableValueField].HasValue == true" or "[NullableValueField] == null".
This works, as long as the field itself is present in the document.
But when the field is missing, the result of the query contains unexpected documents.
A filter like "IsLocked != null" will return documents, where the field does not exist.
RavenDB 5.4.112
.net 7.0.14 x64
Here the failing test:
Beta Was this translation helpful? Give feedback.
All reactions