Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating to latest, adding tips

  • Loading branch information...
commit 49eea35d55553c4114a6ffecd9d158da7ce28be2 1 parent cc3e3f5
@durran durran authored
View
1  en/mongoid/docs/callbacks.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/contributing.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
5 en/mongoid/docs/documents.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
@@ -161,12 +162,12 @@
<li><code>Array</code></li>
<li><code>BigDecimal</code></li>
<li><code>Boolean</code></li>
- <li><code>BSON::ObjectId</code></li>
<li><code>Date</code></li>
<li><code>DateTime</code></li>
<li><code>Float</code></li>
<li><code>Hash</code></li>
<li><code>Integer</code></li>
+ <li><code>Moped::BSON::ObjectId</code></li>
<li><code>Range</code></li>
<li><code>Regexp</code></li>
<li><code>String</code></li>
@@ -308,7 +309,7 @@
</p>
<h3>Creating Custom Ids</h3>
<p>
- For cases when you do not want to have <code>BSON::ObjectId</code> ids, you
+ For cases when you do not want to have <code>Moped::BSON::ObjectId</code> ids, you
can override Mongoid's <code>_id</code> field and set them to whatever you
like.
</p>
View
1  en/mongoid/docs/extras.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/identity_map.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/indexing.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/installation.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/nested_attributes.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/performance.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/persistence.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/querying.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/docs/rails.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
16 en/mongoid/docs/relations.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
@@ -846,9 +847,10 @@
<code>Model#{name}.concat</code>
<p class='doc'>
<i>
- Push multiplpe document onto the relation. If the parent is
+ Push multiple documents onto the relation. If the parent is
persisted, then the child documents will be automatically
- saved.
+ saved. <b>This is a batch operation that runs validations, but
+ no other callbacks.</b>
</i>
</p>
</td>
@@ -1404,9 +1406,10 @@
<code>Model#{name}.concat</code>
<p class='doc'>
<i>
- Push multiplpe document onto the relation. If the parent is
+ Push multiple documents onto the relation. If the parent is
persisted, then the child documents will be automatically
- saved in a single batch.
+ saved in a single batch. <b>This is a batch operation that runs
+ validations, but no other callbacks.</b>
</i>
</p>
</td>
@@ -1760,9 +1763,10 @@
<code>Model#{name}.concat</code>
<p class='doc'>
<i>
- Push multiplpe document onto the relation. If the parent is
+ Push multiple documents onto the relation. If the parent is
persisted, then the child documents will be automatically
- saved in a single batch.
+ saved in a single batch. <b>This is a batch operation that
+ runs validations, but no other callbacks.</b>
</i>
</p>
</td>
View
216 en/mongoid/docs/tips.html
@@ -0,0 +1,216 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <meta content='A Ruby ODM for MongoDB' name='description' />
+ <meta content='mongoid, mongodb, ruby, rails, odm, durran jordan' name='keywords' />
+ <link href="/stylesheets/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css" />
+ <link href="/stylesheets/mongoid.css" media="screen" rel="stylesheet" type="text/css" />
+ <link href="/stylesheets/mongoid-coderay.css" media="screen" rel="stylesheet" type="text/css" />
+ <link href="/stylesheets/bootstrap-responsive.min.css" media="screen" rel="stylesheet" type="text/css" />
+ <script src="/javascripts/jquery-1.7.2.js" type="text/javascript"></script>
+ <script src="/javascripts/bootstrap-dropdown.js" type="text/javascript"></script>
+ <script src="/javascripts/bootstrap-scrollspy.js" type="text/javascript"></script>
+ <script src="/javascripts/bootstrap-tooltip.js" type="text/javascript"></script>
+ <script src="/javascripts/mongoid.js" type="text/javascript"></script>
+ <title>Mongoid: Tips</title>
+ </head>
+ <body data-offset='100' data-spy='scroll' data-target='.page-nav'>
+ <div class='basic' id='header'>
+ <div class='navbar navbar-fixed-top'>
+ <div class='navbar-inner'>
+ <div class='container'>
+ <ul class='nav'>
+ <li class='dropdown link' id='project'>
+ <a title="Mongoid" href="/en/mongoid/"><img src="/images/mongoid-logo-small-green.png" />
+ </a>
+
+ </li>
+ <li class='link'>
+ <a title="Origin" href="/en/origin/"><img src="/images/origin-logo-small-white.png" />
+ </a>
+
+ </li>
+ <li class='link'>
+ <a title="Moped" href="/en/moped/"><img src="/images/moped-logo-small-white.png" />
+ </a>
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id='navigation'>
+ <div class='subnav'>
+ <div class='container'>
+ <ul class='nav nav-pills'>
+ <li><a href="/en/mongoid/">HOME</a></li>
+ <li class='dropdown' id='docs'>
+ <a class='dropdown-toggle' data-toggle='dropdown' href='#docs'>
+ DOCS
+ <b class='caret'></b>
+ </a>
+ <ul class='dropdown-menu'>
+ <li><a href="/en/mongoid/docs/installation.html">Installation</a></li>
+ <li><a href="/en/mongoid/docs/documents.html">Documents</a></li>
+ <li><a href="/en/mongoid/docs/persistence.html">Persistence</a></li>
+ <li><a href="/en/mongoid/docs/querying.html">Querying</a></li>
+ <li><a href="/en/mongoid/docs/relations.html">Relations</a></li>
+ <li><a href="/en/mongoid/docs/nested_attributes.html">Nested Attributes</a></li>
+ <li><a href="/en/mongoid/docs/identity_map.html">Identity Map</a></li>
+ <li><a href="/en/mongoid/docs/callbacks.html">Callbacks</a></li>
+ <li><a href="/en/mongoid/docs/validation.html">Validation</a></li>
+ <li><a href="/en/mongoid/docs/indexing.html">Indexing</a></li>
+ <li><a href="/en/mongoid/docs/rails.html">Rails</a></li>
+ <li><a href="/en/mongoid/docs/extras.html">Extras</a></li>
+ <li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
+ <li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
+ <li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
+ </ul>
+ </li>
+ <li><a href="/en/mongoid/links.html">LINKS</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div id='content'>
+ <div class='container'>
+ <h1>Tips and FAQs</h1>
+ <div class='page-nav'>
+ <div class='container'>
+ <ul class='nav nav-pills'>
+ <li><a href="#ruby">Ruby 1.9.3</a></li>
+ <li><a href="#count_performance">Count Performance</a></li>
+ <li><a href="#reorder_embedded">Reordering Embedded Docs</a></li>
+ <li><a href="#gridfs">GridFS</a></li>
+ <li><a href="#relational_associations">Relational Associations</a></li>
+ </ul>
+ </div>
+ </div>
+ <section id='ruby'>
+ <h2>Ruby 1.9.3</h2>
+ <p>
+ Until 1.9.3, Ruby did not have a way to decode binary string data accurately
+ for both big endian and little endian systems across all the data types used
+ in the MongoDB wire protocol. All data sent via the wire protocal, as well
+ as the BSON specification itself use little endian and the ability to decode
+ 32 bit and 64 bit signed longs and ints did not arrive in Ruby until this
+ version. See <a href="http://ruby-doc.org/core-1.9.3/String.html#method-i-unpack">
+ <code>String#unpack</code></a> and
+ <a href="http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol">Mongo Wire Protocol</a>
+ for more detailed information.
+ </p>
+ <p>
+ What this means is that prior to 1.9.3, the data received back from big
+ endian systems such as SPARC would get incorrect data decoded when receiving
+ replys from the database. We have thus made 1.9.3 the minimum requirement
+ to be able to support all architectures.
+ </p>
+ <p>
+ For those of you on Heroku bamboo, you will need to do two things in order to
+ run on 1.9.3 in your applications. First, you will need to upgrade to the
+ Cedar stack, and then you will need to specify 1.9.3 as your Ruby in your
+ application's <code>Gemfile</code>.
+ See <a href="http://blog.heroku.com/archives/2012/5/9/multiple_ruby_version_support_on_heroku/">
+ Multiple Rubies on Heroku</a> for instructions on making this migration.
+ </p>
+ </section>
+ <section id='count_performance'>
+ <h2>Count Performance</h2>
+ <p>
+ MongoDB uses non counting B-Tree indexes which causes issuing count commands
+ extremely slow when providing a selector with the command. For example:
+ </p>
+ <div class="CodeRay">
+ <div class="code"><pre><span class="constant">Band</span>.where(name: <span class="string"><span class="delimiter">&quot;</span><span class="content">Depeche Mode</span><span class="delimiter">&quot;</span></span>).count&#x000A;session[<span class="symbol">:bands</span>].find(name: <span class="string"><span class="delimiter">&quot;</span><span class="content">Depeche Mode</span><span class="delimiter">&quot;</span></span>).count&#x000A;</pre></div>
+ </div>
+ <p>
+ This doesn't affect queries on small data sets, but large data sets (millions
+ od documents) can experience count queries in the neighborhood of seconds,
+ which can easily cripple application performance.
+ <ul>
+ <li>See: <a href="http://jira.mongodb.org/browse/SERVER-1752">SERVER-1752</a></li>
+ <li>See: <a href="http://jira.mongodb.org/browse/SERVER-2274">SERVER-2274</a></li>
+ </ul>
+ </p>
+ </section>
+ <section id='reorder_embedded'>
+ <h2>Reodering Embedded Documents</h2>
+ <p>
+ Due to only a partially implemented feature in MongoDB, the <code>$</code>
+ positional operator, it is not possible to accurately update embedded
+ documents that are nested more than one level deep based on a query
+ selector. For example:
+ </p>
+ <div class="CodeRay">
+ <div class="code"><pre>session[<span class="symbol">:bands</span>].find(&#x000A; <span class="string"><span class="delimiter">&quot;</span><span class="content">_id</span><span class="delimiter">&quot;</span></span> =&gt; <span class="integer">1</span>,&#x000A; <span class="string"><span class="delimiter">&quot;</span><span class="content">albums._id</span><span class="delimiter">&quot;</span></span> =&gt; <span class="integer">2</span>,&#x000A; <span class="string"><span class="delimiter">&quot;</span><span class="content">albums.tracks._id</span><span class="delimiter">&quot;</span></span> =&gt; <span class="integer">3</span>,&#x000A;).update(&#x000A; <span class="string"><span class="delimiter">&quot;</span><span class="content">$set</span><span class="delimiter">&quot;</span></span> =&gt; { <span class="string"><span class="delimiter">&quot;</span><span class="content">albums.$.tracks.$.name</span><span class="delimiter">&quot;</span></span> =&gt; <span class="string"><span class="delimiter">&quot;</span><span class="content">Sober</span><span class="delimiter">&quot;</span></span> }&#x000A;)&#x000A;</pre></div>
+ </div>
+ <p>
+ The above query does not work, and is not possible in MongoDB. To get around
+ this, Mongoid stores the index of the embedded documents in memory, and
+ would execute the same query like so:
+ </p>
+ <div class="CodeRay">
+ <div class="code"><pre>session[<span class="symbol">:bands</span>].find(&#x000A; <span class="string"><span class="delimiter">&quot;</span><span class="content">_id</span><span class="delimiter">&quot;</span></span> =&gt; <span class="integer">1</span>,&#x000A; <span class="string"><span class="delimiter">&quot;</span><span class="content">albums._id</span><span class="delimiter">&quot;</span></span> =&gt; <span class="integer">2</span>,&#x000A; <span class="string"><span class="delimiter">&quot;</span><span class="content">albums.tracks._id</span><span class="delimiter">&quot;</span></span> =&gt; <span class="integer">3</span>,&#x000A;).update(&#x000A; <span class="string"><span class="delimiter">&quot;</span><span class="content">$set</span><span class="delimiter">&quot;</span></span> =&gt; { <span class="string"><span class="delimiter">&quot;</span><span class="content">albums.0.tracks.2.name</span><span class="delimiter">&quot;</span></span> =&gt; <span class="string"><span class="delimiter">&quot;</span><span class="content">Sober</span><span class="delimiter">&quot;</span></span> }&#x000A;)&#x000A;</pre></div>
+ </div>
+ <p>
+ This works, however it comes with a caveat in that you cannot reorder your
+ embedded documents in another process. If you were to do so, Mongoid would
+ be updating the incorrect field. It is recommended until this is fixed that
+ you sort your documents in memory and leave the underlying order untouched.
+ See <a href="http://jira.mongodb.org/browse/SERVER-831">SERVER-831</a> for
+ more information.
+ </p>
+ </section>
+ <section id='gridfs'>
+ <h2>No GridFS Support</h2>
+ <p>
+ GridFS is marketed as a core database feature, when in fact it is not. It is
+ simply a <i>pattern</i> for stored chunked file data as documents in a
+ collection, just like any other document. The implementation of this
+ behaviour is handled in the client drivers, not in the core database itself,
+ which can lead to discrepencies in how this is handled across platforms.
+ </p>
+ <p>
+ Even if having this behaviour in the client is acceptable, the effects of this
+ on application performance where you are not just storing file data is quite
+ large. Since files are stored as documents, they consume RAM just as any other
+ document in the database would, and can easily cause memory consumption on
+ your server to max out. There are also limitations in chunking the data, such
+ as you do not have the ability to update a file - you must delete the file
+ and replace it with a new one.
+ </p>
+ <p>
+ Instead of providing support for this, we simply recommend you use a service
+ for storing files that is designed for this, such as Amazon S3.
+ </p>
+ </section>
+ <section id='relational_associations'>
+ <h2>Relational Associations</h2>
+ <p>
+ Mongoid provides relational-style associations as a convenience for
+ application developers who are used to dealing with relational databases,
+ but we do not recommend you use these extensively.
+ </p>
+ <p>
+ MongoDB provides no transactions, and no join support, so it is
+ impossible to ensure that the database is kept in a consistent state with
+ regards to referencing documents from one collection to another. Also,
+ without support for joins, you will find that the number of database
+ queries executed grows in order to retrieve documents with their
+ associations, and can have a huge affect on performance since this is
+ not where MongoDB's power lies.
+ </p>
+ <p>
+ If you find that you have more relational associations in your application
+ than embedded ones, it is recommended that you not use MongoDB and move
+ to a relational database. Also, you will probably find this feature removed
+ in future versions of Mongoid, in order to not allow developers to use
+ the database in an incorrect fashion.
+ </p>
+ </section>
+ </div>
+ </div>
+ </body>
+</html>
View
10 en/mongoid/docs/upgrading.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
@@ -102,8 +103,11 @@
<ul class='incompatible'>
<li>
<i class='icon-warning-sign'></i>
- bson and bson_ext gems are no longer compatible. Please remove both from
- your Gemfile and any other dependencies. They have been replaced by Moped.
+ bson and bson_ext gems are no longer necessary, and `BSON::ObjectId` objects
+ are no longer compatible with Mongoid documents. Use
+ <code>Moped::BSON::ObjectId</code> instead. It is safe to remove both gems
+ from your Gemfile and any other dependencies. They have been replaced by
+ Moped (see <a href="/en/moped/docs/bson.html"><code>Moped::BSON</code></a>).
</li>
<li>
<i class='icon-warning-sign'></i>
@@ -208,7 +212,7 @@
<code>:pre_processed</code> to true.
</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">:_id</span>,&#x000A; type: <span class="constant">String</span>,&#x000A; pre_processed: <span class="predefined-constant">true</span>,&#x000A; default: -&gt;{ <span class="constant">BSON</span>::<span class="constant">ObjectId</span>.new.to_s }&#x000A;<span class="keyword">end</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">:_id</span>,&#x000A; type: <span class="constant">String</span>,&#x000A; pre_processed: <span class="predefined-constant">true</span>,&#x000A; default: -&gt;{ <span class="constant">Moped</span>::<span class="constant">BSON</span>::<span class="constant">ObjectId</span>.new.to_s }&#x000A;<span class="keyword">end</span>&#x000A;</pre></div>
</div>
</li>
<li>
View
1  en/mongoid/docs/validation.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/index.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
1  en/mongoid/links.html
@@ -66,6 +66,7 @@
<li><a href="/en/mongoid/docs/upgrading.html">Upgrading</a></li>
<li><a href="/en/mongoid/docs/contributing.html">Contributing</a></li>
<li><a href="/en/mongoid/docs/performance.html">Performance</a></li>
+ <li><a href="/en/mongoid/docs/tips.html">Tips/FAQs</a></li>
</ul>
</li>
<li><a href="/en/mongoid/links.html">LINKS</a></li>
View
13 en/moped/docs/bson.html
@@ -68,12 +68,13 @@
<p>
<code>Moped::BSON</code> is the namespace for Moped's BSON implementation.
It's implemented in pure (but fast) ruby. The public entry point into the
- <code>BSON</code> module is <code>BSON::Document</code>, which is just a
- subclass of Hash, but exposes two class methods: <code>serialize</code>
- and <code>deserialize</code>. <code>serialize</code> accepts a
- <code>BSON::Document</code> (or Hash) and returns the serialized BSON
- representation. <code>deserialize</code> does the opposite: it reads data
- from an IO-like input and returns a deserialized <code>BSON::Document</code>.
+ <code>Moped::BSON</code> module is <code>Moped::BSON::Document</code>, which
+ is just a subclass of Hash, but exposes two class methods:
+ <code>serialize</code> and <code>deserialize</code>. <code>serialize</code>
+ accepts a <code>Moped::BSON::Document</code> (or Hash) and returns the
+ serialized BSON representation. <code>deserialize</code> does the opposite: it
+ reads data from an IO-like input and returns a deserialized
+ <code>Moped::BSON::Document</code>.
</p>
<div class='page-nav'>
<div class='container'>
View
2  en/origin/docs/options.html
@@ -334,7 +334,7 @@
Choose the syntax you like the best.
</p>
<div class="CodeRay">
- <div class="code"><pre>queryable.desc(<span class="symbol">:first_name</span>, <span class="symbol">:last_name</span>)&#x000A;queryable.order_by(<span class="symbol">:first_name</span>.desc, <span class="symbol">:last_name</span>.desc)&#x000A;queryable.order_by(<span class="string"><span class="delimiter">&quot;</span><span class="content">first_name DESC, last_name DESC</span><span class="delimiter">&quot;</span></span>)&#x000A;queryable.order_by(first_name: <span class="integer">1</span>, last_name: <span class="integer">1</span>)&#x000A;queryable.order_by(first_name: <span class="string"><span class="delimiter">&quot;</span><span class="content">desc</span><span class="delimiter">&quot;</span></span>, last_name: <span class="string"><span class="delimiter">&quot;</span><span class="content">desc</span><span class="delimiter">&quot;</span></span>)&#x000A;queryable.order_by(first_name: <span class="symbol">:desc</span>, last_name: <span class="symbol">:desc</span>)&#x000A;queryable.order_by([[ <span class="symbol">:first_name</span>, <span class="integer">1</span> ], [ <span class="symbol">:last_name</span>, <span class="integer">1</span> ]])&#x000A;queryable.order_by([[ <span class="symbol">:first_name</span>, <span class="symbol">:desc</span> ], [ <span class="symbol">:last_name</span>, <span class="symbol">:desc</span> ]])&#x000A;</pre></div>
+ <div class="code"><pre>queryable.desc(<span class="symbol">:first_name</span>, <span class="symbol">:last_name</span>)&#x000A;queryable.order_by(<span class="symbol">:first_name</span>.desc, <span class="symbol">:last_name</span>.desc)&#x000A;queryable.order_by(<span class="string"><span class="delimiter">&quot;</span><span class="content">first_name DESC, last_name DESC</span><span class="delimiter">&quot;</span></span>)&#x000A;queryable.order_by(first_name: <span class="integer">-1</span>, last_name: <span class="integer">-1</span>)&#x000A;queryable.order_by(first_name: <span class="string"><span class="delimiter">&quot;</span><span class="content">desc</span><span class="delimiter">&quot;</span></span>, last_name: <span class="string"><span class="delimiter">&quot;</span><span class="content">desc</span><span class="delimiter">&quot;</span></span>)&#x000A;queryable.order_by(first_name: <span class="symbol">:desc</span>, last_name: <span class="symbol">:desc</span>)&#x000A;queryable.order_by([[ <span class="symbol">:first_name</span>, <span class="integer">-1</span> ], [ <span class="symbol">:last_name</span>, <span class="integer">-1</span> ]])&#x000A;queryable.order_by([[ <span class="symbol">:first_name</span>, <span class="symbol">:desc</span> ], [ <span class="symbol">:last_name</span>, <span class="symbol">:desc</span> ]])&#x000A;</pre></div>
</div>
<p>
All of the previous calls translate to the following options:
Please sign in to comment.
Something went wrong with that request. Please try again.