2017-02-09 53 views
0

使用嗎啡我如何可以查詢記錄,他們的「項目」字段是類型的數組是空的 - 沒有itmes空數組字段嗎啡檢查

我嘗試這樣做:

userQueryDS.field("items").greaterThan(0); 

但這顯然不工作給這個錯誤:

The type(s) for the query/update may be inconsistent; using an instance of type 'java.lang.Integer' for the field 'com.model.User.devices' which is declared as 'java.util.List'

回答

0

你可以嘗試這樣的事情。兩種變體都應該可以工

userQueryDS.criteria("items").sizeEq(0); 

userQueryDS.field("items").sizeEq(0);