Boolean

Introduction

The Filter method can be used to filter boolean and nullable boolean fields in a couple of ways. Below is a list of use cases and examples illustrating the available methods.

Existence

To search for documents where a boolean field has a value, we can use the Exists method. The below search will find blog posts that has an Approved property with a value. In other words, the below code is similar to the LINQ query Where(x => x.Approved.HasValue).