1
我正在使用ArangoDB java驅動程序,並試圖查詢包含一系列字符串的文檔,這些字符串存儲在列表中的arangoDB文檔中。我在查詢中使用ArrayList和一個字符串列表。ArangoDB多個OR查詢?
Query:
FOR document IN documents FILTER (@now - document.dateAdded < 2592000000) &&
(document.categories IN @categories || document.tags IN @tags
|| document.locations IN @locations) RETURN document
Map<String, Object> bindVars = new MapBuilder().put("now", now).put("categories", categories).put("@tags", tags).put("@locations", locations).get();
「now」包含一個long。所有其他人都是ArrayList<String>.
這是拋出一個錯誤,解釋「bind parameter '@tags' has an invalid value or type
」。由於這個ArrayList與其他的沒什麼不同,我唯一的理論是我輸入的邏輯不正確。如何做一個查詢:
FunctionCondition1 AND (condition2 OR condition3 OR condition4)
你可以嘗試以下方法:bindVars =新MapBuilder()把( 「現在」,現在)。把( 「類別」,類別)。把( 「標籤」,標籤)。把(「位置。 「,locations).get(); – fceller
綁定變量在查詢中使用「@」標記,但沒有第一個「@」。一個集合參數被指定爲「@@ myvariablecollection」處的兩個。如果bind var是「@myvariablecollection」並且必須是集合類型。 – fceller
感謝您的解決方案,您可以發佈一個快速答案,以便我可以給你適當的積分? – User093203920