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?
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 BHowever when you then call
findAll(input, D, C)you got errorDue to limitations of the org.bson.Document, you can't add a second '$and' expressionThis is because the final overall criteria looks like this:
So you end-up with duplicate
$andkeys.Do you have any solution for this?