Ecto + Elixir: How do I query a hashmap field?
<p>I have a model:</p>

<pre><code>defmodule VideoChat.User do
  use VideoChat.Web, :model

  schema "users" do
    field :device_identifier, :string
    field :matches, :map

    timestamps()
  end

  ...
end
</code></pre>

<p>How would I look for all users with a "cool" key in their <code>matches</code> hash?</p>

<p><code>User |&gt; where([u], u.matches["cool"] != nil) |&gt; limit(1) |&gt; VideoChat.Repo.one</code></p>