

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Query Objects &mdash; MongoAlchemy v0.8 documentation</title>
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '0.8',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="MongoAlchemy v0.8 documentation" href="../../index.html" />
    <link rel="up" title="Expression Language — Querying and Updating" href="index.html" />
    <link rel="next" title="Mongo Query Expression Language" href="query_expressions.html" />
    <link rel="prev" title="Expression Language — Querying and Updating" href="index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="query_expressions.html" title="Mongo Query Expression Language"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Expression Language — Querying and Updating"
             accesskey="P">previous</a> |</li>
        <li><a href="../../index.html">MongoAlchemy v0.8 documentation</a> &raquo;</li>
          <li><a href="../index.html" >API documentation</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">Expression Language — Querying and Updating</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="query-objects">
<h1>Query Objects<a class="headerlink" href="#query-objects" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="mongoalchemy.query.Query">
<em class="property">class </em><tt class="descclassname">mongoalchemy.query.</tt><tt class="descname">Query</tt><big>(</big><em>type</em>, <em>session</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query" title="Permalink to this definition">¶</a></dt>
<dd><p>A query object has all of the methods necessary to programmatically 
generate a mongo query as well as methods to retrieve results of the 
query or do an update based on it.</p>
<p>In general a query object should be created via <tt class="docutils literal"><span class="pre">Session.query</span></tt>, 
not directly.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>type</strong> &#8211; A subclass of class:<cite>mongoalchemy.document.Document</cite></li>
<li><strong>db</strong> &#8211; The <a class="reference internal" href="../session.html#mongoalchemy.session.Session" title="mongoalchemy.session.Session"><tt class="xref py py-class docutils literal"><span class="pre">Session</span></tt></a> which this query is associated with.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="mongoalchemy.query.Query.resolve_name">
<tt class="descname">resolve_name</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.resolve_name" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="mongoalchemy.query.Query.query">
<tt class="descname">query</tt><a class="headerlink" href="#mongoalchemy.query.Query.query" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.raw_output">
<tt class="descname">raw_output</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.raw_output" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.get_fields">
<tt class="descname">get_fields</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.get_fields" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.get_limit">
<tt class="descname">get_limit</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.get_limit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.get_skip">
<tt class="descname">get_skip</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.get_skip" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.limit">
<tt class="descname">limit</tt><big>(</big><em>limit</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.limit" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the limit on the number of documents returned</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>limit</strong> &#8211; the number of documents to return</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.skip">
<tt class="descname">skip</tt><big>(</big><em>skip</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.skip" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the number of documents to skip in the result</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>skip</strong> &#8211; the number of documents to skip</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.clone">
<tt class="descname">clone</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.clone" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a clone of the current query and all settings.  Further
updates to the cloned object or the original object will not 
affect each other</p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.one">
<tt class="descname">one</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.one" title="Permalink to this definition">¶</a></dt>
<dd><p>Execute the query and return one result.  If more than one result 
is returned, raises a <tt class="docutils literal"><span class="pre">BadResultException</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.first">
<tt class="descname">first</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.first" title="Permalink to this definition">¶</a></dt>
<dd><p>Execute the query and return the first result.  Unlike <tt class="docutils literal"><span class="pre">one</span></tt>, if
there are multiple documents it simply returns the first one.  If
there are no documents, first returns <tt class="xref docutils literal"><span class="pre">None</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.hint_asc">
<tt class="descname">hint_asc</tt><big>(</big><em>qfield</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.hint_asc" title="Permalink to this definition">¶</a></dt>
<dd><p>Applies a hint for the query that it should use a 
(<tt class="docutils literal"><span class="pre">qfield</span></tt>, ASCENDING) index when performing the query.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>qfield</strong> &#8211; the instance of <tt class="xref py py-class docutils literal"><span class="pre">mongoalchemy.QueryField</span></tt> to use as the key.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.hint_desc">
<tt class="descname">hint_desc</tt><big>(</big><em>qfield</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.hint_desc" title="Permalink to this definition">¶</a></dt>
<dd><p>Applies a hint for the query that it should use a 
(<tt class="docutils literal"><span class="pre">qfield</span></tt>, DESCENDING) index when performing the query.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>qfield</strong> &#8211; the instance of <tt class="xref py py-class docutils literal"><span class="pre">mongoalchemy.QueryField</span></tt> to use as the key.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.explain">
<tt class="descname">explain</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.explain" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes an explain operation on the database for the current 
query and returns the raw explain object returned.</p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.all">
<tt class="descname">all</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.all" title="Permalink to this definition">¶</a></dt>
<dd><p>Return all of the results of a query in a list</p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.distinct">
<tt class="descname">distinct</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.distinct" title="Permalink to this definition">¶</a></dt>
<dd><p>Execute this query and return all of the unique values 
of <tt class="docutils literal"><span class="pre">key</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>key</strong> &#8211; the instance of <tt class="xref py py-class docutils literal"><span class="pre">mongoalchemy.QueryField</span></tt> to use as the distinct key.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.filter">
<tt class="descname">filter</tt><big>(</big><em>*query_expressions</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.filter" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply the given query expressions to this query object</p>
<p><strong>Example</strong>: <tt class="docutils literal"><span class="pre">s.query(SomeObj).filter(SomeObj.age</span> <span class="pre">&gt;</span> <span class="pre">10,</span> <span class="pre">SomeObj.blood_type</span> <span class="pre">==</span> <span class="pre">'O')</span></tt></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>query_expressions</strong> &#8211; Instances of <a class="reference internal" href="query_expressions.html#mongoalchemy.query_expression.QueryExpression" title="mongoalchemy.query_expression.QueryExpression"><tt class="xref py py-class docutils literal"><span class="pre">mongoalchemy.query_expression.QueryExpression</span></tt></a></td>
</tr>
</tbody>
</table>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="query_expressions.html#mongoalchemy.query_expression.QueryExpression" title="mongoalchemy.query_expression.QueryExpression"><tt class="xref py py-class docutils literal"><span class="pre">QueryExpression</span></tt></a> class</p>
</div>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.filter_by">
<tt class="descname">filter_by</tt><big>(</big><em>**filters</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.filter_by" title="Permalink to this definition">¶</a></dt>
<dd><p>Filter for the names in <tt class="docutils literal"><span class="pre">filters</span></tt> being equal to the associated 
values.  Cannot be used for sub-objects since keys must be strings</p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.count">
<tt class="descname">count</tt><big>(</big><em>with_limit_and_skip=False</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.count" title="Permalink to this definition">¶</a></dt>
<dd><p>Execute a count on the number of results this query would return.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>with_limit_and_skip</strong> &#8211; Include <tt class="docutils literal"><span class="pre">.limit()</span></tt> and <tt class="docutils literal"><span class="pre">.skip()</span></tt> arguments in the count?</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.fields">
<tt class="descname">fields</tt><big>(</big><em>*fields</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.fields" title="Permalink to this definition">¶</a></dt>
<dd><p>Only return the specified fields from the object.  Accessing a             field that was not specified in <tt class="docutils literal"><span class="pre">fields</span></tt> will result in a             :class:<tt class="docutils literal"><span class="pre">mongoalchemy.document.FieldNotRetrieved</span></tt> exception being             raised</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fields</strong> &#8211; Instances of :class:<tt class="docutils literal"><span class="pre">mongoalchemy.query.QueryField</span></tt> specifying                 which fields to return</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.ascending">
<tt class="descname">ascending</tt><big>(</big><em>qfield</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.ascending" title="Permalink to this definition">¶</a></dt>
<dd><p>Sort the result based on <tt class="docutils literal"><span class="pre">qfield</span></tt> in ascending order.  These calls 
can be chained to sort by multiple fields.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>qfield</strong> &#8211; Instance of :class:<tt class="docutils literal"><span class="pre">mongoalchemy.query.QueryField</span></tt>                 specifying which field to sort by.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.descending">
<tt class="descname">descending</tt><big>(</big><em>qfield</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.descending" title="Permalink to this definition">¶</a></dt>
<dd><p>Sort the result based on <tt class="docutils literal"><span class="pre">qfield</span></tt> in ascending order.  These calls 
can be chained to sort by multiple fields.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>qfield</strong> &#8211; Instance of :class:<tt class="docutils literal"><span class="pre">mongoalchemy.query.QueryField</span></tt>                 specifying which field to sort by.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.not_">
<tt class="descname">not_</tt><big>(</big><em>*query_expressions</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.not_" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a $not expression to the query, negating the query expressions 
given.</p>
<p><strong>Examples</strong>: <tt class="docutils literal"><span class="pre">query.not_(SomeDocClass.age</span> <span class="pre">&lt;=</span> <span class="pre">18)</span></tt> becomes <tt class="docutils literal"><span class="pre">{'age'</span> <span class="pre">:</span> <span class="pre">{</span> <span class="pre">'$not'</span> <span class="pre">:</span> <span class="pre">{</span> <span class="pre">'$gt'</span> <span class="pre">:</span> <span class="pre">18</span> <span class="pre">}</span> <span class="pre">}}</span></tt></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>query_expressions</strong> &#8211; Instances of <a class="reference internal" href="query_expressions.html#mongoalchemy.query_expression.QueryExpression" title="mongoalchemy.query_expression.QueryExpression"><tt class="xref py py-class docutils literal"><span class="pre">mongoalchemy.query_expression.QueryExpression</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.or_">
<tt class="descname">or_</tt><big>(</big><em>first_qe</em>, <em>*qes</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.or_" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a $not expression to the query, negating the query expressions 
given.  The <tt class="docutils literal"><span class="pre">|</span> <span class="pre">operator</span></tt> on query expressions does the same thing</p>
<p><strong>Examples</strong>: <tt class="docutils literal"><span class="pre">query.or_(SomeDocClass.age</span> <span class="pre">==</span> <span class="pre">18,</span> <span class="pre">SomeDocClass.age</span> <span class="pre">==</span> <span class="pre">17)</span></tt> becomes <tt class="docutils literal"><span class="pre">{'$or'</span> <span class="pre">:</span> <span class="pre">[{</span> <span class="pre">'age'</span> <span class="pre">:</span> <span class="pre">18</span> <span class="pre">},</span> <span class="pre">{</span> <span class="pre">'age'</span> <span class="pre">:</span> <span class="pre">17</span> <span class="pre">}]}</span></tt></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>query_expressions</strong> &#8211; Instances of <a class="reference internal" href="query_expressions.html#mongoalchemy.query_expression.QueryExpression" title="mongoalchemy.query_expression.QueryExpression"><tt class="xref py py-class docutils literal"><span class="pre">mongoalchemy.query_expression.QueryExpression</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.in_">
<tt class="descname">in_</tt><big>(</big><em>qfield</em>, <em>*values</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.in_" title="Permalink to this definition">¶</a></dt>
<dd><p>Check to see that the value of <tt class="docutils literal"><span class="pre">qfield</span></tt> is one of <tt class="docutils literal"><span class="pre">values</span></tt></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>qfield</strong> &#8211; Instances of <a class="reference internal" href="query_expressions.html#mongoalchemy.query_expression.QueryExpression" title="mongoalchemy.query_expression.QueryExpression"><tt class="xref py py-class docutils literal"><span class="pre">mongoalchemy.query_expression.QueryExpression</span></tt></a></li>
<li><strong>values</strong> &#8211; Values should be python values which <tt class="docutils literal"><span class="pre">qfield</span></tt>                 understands</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.nin">
<tt class="descname">nin</tt><big>(</big><em>qfield</em>, <em>*values</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.nin" title="Permalink to this definition">¶</a></dt>
<dd><p>Check to see that the value of <tt class="docutils literal"><span class="pre">qfield</span></tt> is not one of <tt class="docutils literal"><span class="pre">values</span></tt></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>qfield</strong> &#8211; Instances of <a class="reference internal" href="query_expressions.html#mongoalchemy.query_expression.QueryExpression" title="mongoalchemy.query_expression.QueryExpression"><tt class="xref py py-class docutils literal"><span class="pre">mongoalchemy.query_expression.QueryExpression</span></tt></a></li>
<li><strong>values</strong> &#8211; Values should be python values which <tt class="docutils literal"><span class="pre">qfield</span></tt>                 understands</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.find_and_modify">
<tt class="descname">find_and_modify</tt><big>(</big><em>new=False</em>, <em>remove=False</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.find_and_modify" title="Permalink to this definition">¶</a></dt>
<dd><p>The mongo &#8220;find and modify&#8221; command.  Behaves like an update expression
in that &#8220;execute&#8221; must be called to do the update and return the 
results.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>new</strong> &#8211; Whether to return the new object or old (default: False)</li>
<li><strong>remove</strong> &#8211; Whether to remove the object before returning it</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.set">
<tt class="descname">set</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.set" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to: <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.set" title="mongoalchemy.update_expression.UpdateExpression.set"><tt class="xref py py-func docutils literal"><span class="pre">set()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.unset">
<tt class="descname">unset</tt><big>(</big><em>qfield</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.unset" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.unset" title="mongoalchemy.update_expression.UpdateExpression.unset"><tt class="xref py py-func docutils literal"><span class="pre">unset()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.inc">
<tt class="descname">inc</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.inc" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.inc" title="mongoalchemy.update_expression.UpdateExpression.inc"><tt class="xref py py-func docutils literal"><span class="pre">inc()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.append">
<tt class="descname">append</tt><big>(</big><em>qfield</em>, <em>value</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.append" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.append" title="mongoalchemy.update_expression.UpdateExpression.append"><tt class="xref py py-func docutils literal"><span class="pre">append()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.extend">
<tt class="descname">extend</tt><big>(</big><em>qfield</em>, <em>*value</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.extend" title="mongoalchemy.update_expression.UpdateExpression.extend"><tt class="xref py py-func docutils literal"><span class="pre">extend()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.remove">
<tt class="descname">remove</tt><big>(</big><em>qfield</em>, <em>value</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.remove" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.remove" title="mongoalchemy.update_expression.UpdateExpression.remove"><tt class="xref py py-func docutils literal"><span class="pre">remove()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.remove_all">
<tt class="descname">remove_all</tt><big>(</big><em>qfield</em>, <em>*value</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.remove_all" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.remove_all" title="mongoalchemy.update_expression.UpdateExpression.remove_all"><tt class="xref py py-func docutils literal"><span class="pre">remove_all()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.add_to_set">
<tt class="descname">add_to_set</tt><big>(</big><em>qfield</em>, <em>value</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.add_to_set" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.add_to_set" title="mongoalchemy.update_expression.UpdateExpression.add_to_set"><tt class="xref py py-func docutils literal"><span class="pre">add_to_set()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.pop_first">
<tt class="descname">pop_first</tt><big>(</big><em>qfield</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.pop_first" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.pop_first" title="mongoalchemy.update_expression.UpdateExpression.pop_first"><tt class="xref py py-func docutils literal"><span class="pre">pop_first()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.Query.pop_last">
<tt class="descname">pop_last</tt><big>(</big><em>qfield</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.Query.pop_last" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to:  <a class="reference internal" href="update_expressions.html#mongoalchemy.update_expression.UpdateExpression.pop_last" title="mongoalchemy.update_expression.UpdateExpression.pop_last"><tt class="xref py py-func docutils literal"><span class="pre">pop_last()</span></tt></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="mongoalchemy.query.QueryResult">
<em class="property">class </em><tt class="descclassname">mongoalchemy.query.</tt><tt class="descname">QueryResult</tt><big>(</big><em>cursor</em>, <em>type</em>, <em>raw_output=False</em>, <em>fields=None</em><big>)</big><a class="headerlink" href="#mongoalchemy.query.QueryResult" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="mongoalchemy.query.QueryResult.next">
<tt class="descname">next</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.QueryResult.next" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.QueryResult.rewind">
<tt class="descname">rewind</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.QueryResult.rewind" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="mongoalchemy.query.QueryResult.clone">
<tt class="descname">clone</tt><big>(</big><big>)</big><a class="headerlink" href="#mongoalchemy.query.QueryResult.clone" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Expression Language — Querying and Updating</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="query_expressions.html"
                        title="next chapter">Mongo Query Expression Language</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/api/expressions/query.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="query_expressions.html" title="Mongo Query Expression Language"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Expression Language — Querying and Updating"
             >previous</a> |</li>
        <li><a href="../../index.html">MongoAlchemy v0.8 documentation</a> &raquo;</li>
          <li><a href="../index.html" >API documentation</a> &raquo;</li>
          <li><a href="index.html" >Expression Language — Querying and Updating</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2010, Jeffrey Jenkins.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
    </div>
  </body>
</html>