Use filters to narrow down search results or for database-like queries.
You can use the `
Filter` method to filter Boolean and nullable _Boolean_ fields in a couple of ways, as shown in the following use cases and examples.
To search for documents where a Boolean field has a value, use the `
Exists` method. The following search finds blog posts with an `
Approved` property with a value. The below code is similar to the LINQ query `
Where(x => x.Approved.HasValue)`.
You can negate the filter with an exclamation point (!). To find blog posts that lack an `
Approved` property, use the following code.
## Match true or false
For exact matching, use the `
Match` method. The following search matches blog posts whose `
Approved` property is true. The LINQ equivalent is `
Where(x => x.Approved)`.