Elixir + Ecto:如何不在[array]中? [英] Elixir + Ecto: How to do WHERE NOT IN [array]?

查看:74
本文介绍了Elixir + Ecto:如何不在[array]中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试查找所有 match_history 中没有特定字符串元素的 User 领域。我对此进行了猜测:

I am trying to look for all Users that don't have a certain string element in their match_history field. I took a guess with this:

matched_user =用户|>其中([u],^ device_id不在u.match_history中)|>限制(1)|> VideoChat.Repo.one

但它似乎在 not 部分中断了。有办法吗?

But it seems to break at the not part. Is there a way to do this?

推荐答案

尝试

用户|>其中([u],而不是u.match_history中的^ device_id)

这篇关于Elixir + Ecto:如何不在[array]中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆