title: Advanced DataMapper search for Many to Many relation
body: <p>Give the <a href="http://datamapper.org/docs/associations.html" rel="nofollow">Tag/Photo exemple</a> on DataMapper documentation:</p>
  
  <pre><code> class Photo
     include DataMapper::Resource
  
     property :id, Serial
  
     has n, :taggings
     has n, :tags, :through =&gt; :taggings
   end
  
   class Tag
     include DataMapper::Resource
  
     property :id, Serial
  
     has n, :taggings
     has n, :photos, :through =&gt; :taggings
   end
  
   class Tagging
     include DataMapper::Resource
  
     belongs_to :tag,   :key =&gt; true
     belongs_to :photo, :key =&gt; true
   end
  </code></pre>
  
  <p>I want to select all tags that has no photos
  I know I can do</p>
  
  <pre><code>Tag.select { |tag| tag.photos.size &lt; 1}
  </code></pre>
  
  <p>But I'd like more Datamapper syntax. Something like</p>
  
  <pre><code>Tag.all :photos.count.lt =&gt; 1  #not works
  </code></pre>
  
  <p>Is there a way to do this?
  Does anyone knows a nice Datamapper documentation for advanced queries? <a href="http://datamapper.org/docs/find.html" rel="nofollow">Documentation at the site</a> is very nice, but too basic.</p>
  
  <p>Tkz</p>