Permalink
Browse files

Update docs

  • Loading branch information...
1 parent 298c2f0 commit 7a3778742930f124420bb2e0a444c8c3c10a5296 @durran durran committed Sep 22, 2012
Showing with 17 additions and 3 deletions.
  1. +2 −2 en/mongoid/docs/documents.html
  2. +15 −1 en/origin/docs/selection.html
@@ -455,7 +455,7 @@
each of the locales that you plan on searching on.
</p>
<div class="CodeRay">
- <div class="code"><pre><span class="keyword">class</span> <span class="class">Product</span>&#x000A; include <span class="constant">Mongoid</span>::<span class="constant">Document</span>&#x000A; field <span class="symbol">:description</span>, localize: <span class="predefined-constant">true</span>&#x000A;&#x000A; index <span class="string"><span class="delimiter">&quot;</span><span class="content">description.de</span><span class="delimiter">&quot;</span></span>&#x000A; index <span class="string"><span class="delimiter">&quot;</span><span class="content">description.en</span><span class="delimiter">&quot;</span></span>&#x000A;<span class="keyword">end</span>&#x000A;</pre></div>
+ <div class="code"><pre><span class="keyword">class</span> <span class="class">Product</span>&#x000A; include <span class="constant">Mongoid</span>::<span class="constant">Document</span>&#x000A; field <span class="symbol">:description</span>, localize: <span class="predefined-constant">true</span>&#x000A;&#x000A; index <span class="string"><span class="delimiter">&quot;</span><span class="content">description.de</span><span class="delimiter">&quot;</span></span> =&gt; <span class="integer">1</span>&#x000A; index <span class="string"><span class="delimiter">&quot;</span><span class="content">description.en</span><span class="delimiter">&quot;</span></span> =&gt; <span class="integer">1</span>&#x000A;<span class="keyword">end</span>&#x000A;</pre></div>
</div>
<h3>Validation</h3>
<p>
@@ -567,7 +567,7 @@
them will be filtered out.
</p>
<div class="CodeRay">
- <div class="code"><pre><span class="keyword">class</span> <span class="class">Band</span>&#x000A; include <span class="constant">Mongoid</span>::<span class="constant">Document</span>&#x000A; field <span class="symbol">:name</span>, type: <span class="constant">String</span>&#x000A; field <span class="symbol">:origin</span>, type: <span class="constant">String</span>&#x000A;&#x000A; attr_readonly <span class="symbol">:name</span>, origin&#x000A;<span class="keyword">end</span>&#x000A;&#x000A;band = <span class="constant">Band</span>.create(name: <span class="string"><span class="delimiter">&quot;</span><span class="content">Placebo</span><span class="delimiter">&quot;</span></span>)&#x000A;band.update_attributes(name: <span class="string"><span class="delimiter">&quot;</span><span class="content">Tool</span><span class="delimiter">&quot;</span></span>) <span class="comment"># Filters out the name change.</span>&#x000A;</pre></div>
+ <div class="code"><pre><span class="keyword">class</span> <span class="class">Band</span>&#x000A; include <span class="constant">Mongoid</span>::<span class="constant">Document</span>&#x000A; field <span class="symbol">:name</span>, type: <span class="constant">String</span>&#x000A; field <span class="symbol">:origin</span>, type: <span class="constant">String</span>&#x000A;&#x000A; attr_readonly <span class="symbol">:name</span>, <span class="symbol">:origin</span>&#x000A;<span class="keyword">end</span>&#x000A;&#x000A;band = <span class="constant">Band</span>.create(name: <span class="string"><span class="delimiter">&quot;</span><span class="content">Placebo</span><span class="delimiter">&quot;</span></span>)&#x000A;band.update_attributes(name: <span class="string"><span class="delimiter">&quot;</span><span class="content">Tool</span><span class="delimiter">&quot;</span></span>) <span class="comment"># Filters out the name change.</span>&#x000A;</pre></div>
</div>
<p>
If you explicitly try to update or remove the attribute by itself, then
@@ -645,8 +645,22 @@
in front of the selection you want to invert. This will add a <code>$not</code>
clause to the query.
</p>
+ <div class='well'>
+ <table>
+ <tr>
+ <td class='achtung'><img src="/images/achtung.png" /></td>
+ <td class='note'>
+ <p>
+ Note that <code>$not</code> clauses can only be applied to other operators.
+ See the official
+ <a href="http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-Metaoperator%3A{{%24not}}">$not documentation</a> for more information.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
<div class="CodeRay">
- <div class="code"><pre>queryable.not.where(name: <span class="string"><span class="delimiter">&quot;</span><span class="content">Dave</span><span class="delimiter">&quot;</span></span>)&#x000A;queryable.selector <span class="comment">#=&gt; { &quot;$not&quot; =&gt; { &quot;name&quot; =&gt; &quot;Dave&quot; }}</span>&#x000A;&#x000A;</pre></div>
+ <div class="code"><pre>queryable.not.gt(age: <span class="integer">50</span>)&#x000A;queryable.selector <span class="comment">#=&gt; { &quot;age&quot; =&gt; { &quot;$not&quot; =&gt; { &quot;$gt&quot; =&gt; 50 }}}</span>&#x000A;&#x000A;</pre></div>
</div>
</section>
<section id='symbol'>

0 comments on commit 7a37787

Please sign in to comment.