Entity :`code`,`tags`.........等很多列
code為1的資料有100條;code為1,tags.....等列為空的資料有10條
大致代碼如下
ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll().withIncludeNullValues();
Entity entity = Entity.builder().code("1").build();
Example<Entity> example = Example.of(entity, exampleMatcher);
List<Entity> all = entityRepository.findAll(example);
System.out.println(all.size());//列印100條,想查詢的是10條
想查詢code為1,tags.....等列為空的資料(總共10條)
然而查詢結果確為code為1的100條
救救孩子吧
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/23160.html
標籤:MongoDB
