2016-12-06 9 views
7

match_history 필드에 특정 문자열 요소가없는 User을 모두 찾으려고합니다. 나는이와 추측을했다 :Elixir + Ecto : 어떻게 [배열]에 없습니까?

matched_user = User |> where([u], ^device_id not in u.match_history) |> limit(1) |> VideoChat.Repo.one

을하지만 not 부분에 휴식을 보인다. 이것을 할 수있는 방법이 있습니까?

답변

9

는 시도

User |> where([u], not ^device_id in u.match_history)