see on GitHub

Session: Querying: How to use NOT operator?

IDocumentQuery contains NOT operator which can be used to negate next predicate

Note

NOT operator cannot be used alone without succeeding predicate.

Example I

// load up to 128 entities from 'Employees' collection
// where FirstName NOT equals 'Robert'
List<Employee> employees = session.advanced().documentQuery(Employee.class).not()
    .whereEquals(e.firstName, "Robert").toList();

Example II

QEmployee e = QEmployee.employee;
// load up to 128 entities from 'Employees' collection
// where FirstName NOT equals 'Robert'
// and LastName NOT equals 'King'
List<Employee> employees = session.advanced()
    .documentQuery(Employee.class)
    .not()
    .openSubclause()
    .whereEquals(e.firstName, "Robert")
    .andAlso()
    .whereEquals(e.lastName, "King")
    .closeSubclause()
    .toList();