Skip to content

Cannot add more than two Criteria parameters to findAll() method #10

Description

@laubrino

Suppose you want to add three additional criteria A, B, C to the findAll() method. However the method can have only two criteria:

findAll(DataTablesInput input, Criteria additionalCriteria, Criteria preFilteringCriteria)

So one need to join two criteria to one: for example A and B to D: D = A and B

However when you then call findAll(input, D, C) you got error Due to limitations of the org.bson.Document, you can't add a second '$and' expression

This is because the final overall criteria looks like this:

$and [ 
   $and [ .... ],  // criteria derived from 'input' parameter
   C,
   $and [A, B]
]

So you end-up with duplicate $and keys.

Do you have any solution for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions