title: Deep queries with mongodb driver in phoenix/elixir
body: <p>I am using the mongodb driver from <a href="https://github.com/ankhers/mongodb" rel="nofollow noreferrer">https://github.com/ankhers/mongodb</a> to query a mongodb database in an elixir/phoenix project. A simple query such as </p>
  
  <pre><code>cursor = Mongo.find(:mongo, "posts",%{})
        list = Enum.to_list(cursor)
        object= Enum.fetch(list,0)
        object= elem(object, 1) 
        new_list=Map.fetch(object, "name")
        new_list=elem(new_list,1)
        new_cursor= Mongo.find(:mongo, "posts",%{"name" =&gt; new_list})
        new_list=Enum.to_list(new_cursor)
  </code></pre>
  
  <p>is no problem, but I am wondering how to perform deeper searches as I have nested jsons such as </p>
  
  <pre><code>{"posts":{"name":"something","attributes":{"aspect":{"and_so_on":"endpoint"}}}}. 
  </code></pre>
  
  <p>So how to get to "endpoint" in this case ? </p>