camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > MongoDB
Date Mon, 21 May 2012 11:35:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/MongoDB">MongoDB</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~raulvk">Raul Kripalani</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code} <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">from(&quot;mongodb:myDb?database=flights&amp;collection=cancellations&amp;tailTrackIncreasingField=departureTime&amp;persistentTailTracking=true&amp;persistentId=cancellationsTracker&amp;tailTrackDb=trackers&amp;tailTrackCollection=camelTrackers&amp;tailTrackField=lastProcessedDepartureTime&quot;) <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">from(&quot;mongodb:myDb?database=flights&amp;collection=cancellations&amp;tailTrackIncreasingField=departureTime&amp;persistentTailTracking=true&amp;persistentId=cancellationsTracker&amp;tailTrackDb=trackers&quot; + &quot;&amp;tailTrackCollection=camelTrackers&amp;tailTrackField=lastProcessedDepartureTime&quot;) <br></td></tr>
            <tr><td class="diff-unchanged" >	.id(&quot;tailableCursorConsumer3&quot;) <br>	.autoStartup(false) <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="MongoDB-CamelMongoDBcomponent"></a>Camel MongoDB component</h2>

<p><b>Available as of Camel 2.10</b></p>

<p>According to Wikipedia: "NoSQL is a movement promoting a loosely defined class of non-relational data stores that break with a long history of relational databases and ACID guarantees." NoSQL solutions have grown in popularity in the last few years, and major extremely-used sites and services such as Facebook, LinkedIn, Twitter, etc. are known to use them extensively to achieve scalability and agility.</p>

<p>Basically, NoSQL solutions differ from traditional RDBMS (Relational Database Management Systems) in that they don't use SQL as their query language and generally don't offer ACID-like transactional behaviour nor relational data. Instead, they are designed around the concept of flexible data structures and schemas (meaning that the traditional concept of a database table with a fixed schema is dropped), extreme scalability on commodity hardware and blazing-fast processing.</p>

<p>MongoDB is a very popular NoSQL solution and the camel-mongodb component integrates Camel with MongoDB allowing you to interact with MongoDB collections both as a producer (performing operations on the collection) and as a consumer (consuming documents from a MongoDB collection).</p>

<p>MongoDB revolves around the concepts of documents (not as is office documents, but rather hierarchical data defined in JSON/BSON) and collections. This component page will assume you are familiar with them. Otherwise, visit <a href="http://www.mongodb.org/" class="external-link" rel="nofollow">http://www.mongodb.org/</a>.</p>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt> for this component:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;dependency&gt;</span>
    <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>camel-mongodb<span class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>x.x.x<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- use the same version as your Camel core version --&gt;</span></span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>

<h2><a name="MongoDB-URIformat"></a>URI format</h2>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mongodb:connectionBean?database=databaseName&amp;collection=collectionName&amp;operation=operationName[&amp;moreOptions...]
</pre>
</div></div>

<h2><a name="MongoDB-Endpointoptions"></a>Endpoint options</h2>

<p>MongoDB endpoints support the following options, depending on whether they are acting like a Producer or as a Consumer (options vary based on the consumer type too).</p>

<div class="confluenceTableSmall"></div>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Producer </th>
<th class='confluenceTh'> Tailable Cursor Consumer </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>database</tt> </td>
<td class='confluenceTd'> none </td>
<td class='confluenceTd'> <b>Required.</b> The name of the database to which this endpoint will be bound. All operations will be executed against this database unless dynamicity is enabled and the&nbsp;<tt>CamelMongoDbDatabase</tt> header is set. </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>collection</tt> </td>
<td class='confluenceTd'> none </td>
<td class='confluenceTd'> <b>Required.</b> The name of the collection (within the specified database) to which this endpoint will be bound.&nbsp;All operations will be executed against this database unless dynamicity is enabled and the&nbsp;<tt>CamelMongoDbDatabase</tt> header is set. </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>operation</tt> </td>
<td class='confluenceTd'> none </td>
<td class='confluenceTd'> <b>Required for producers.</b> The id of the operation this endpoint will execute. Pick from the following:
<ul>
	<li>Query operations: <tt>findById</tt>, <tt>findOneByQuery</tt>, <tt>findAll</tt>, <tt>count</tt></li>
	<li>Write operations: <tt>insert</tt>, <tt>save</tt>, <tt>update</tt></li>
	<li>Delete operations: <tt>remove</tt></li>
	<li>Other operations: <tt>getDbStats</tt>, <tt>getColStats</tt></li>
</ul>
</td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>createCollection</tt> </td>
<td class='confluenceTd'> true </td>
<td class='confluenceTd'> Determines whether the collection will be automatically created in the MongoDB database during endpoint initialisation if it doesn't exist already. If this option is <tt>false</tt> and the collection doesn't exist, an initialisation exception will be thrown. </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>invokeGetLastError</tt> </td>
<td class='confluenceTd'> false (behaviour may be inherited from connections WriteConcern) </td>
<td class='confluenceTd'> Instructs the MongoDB Java driver to invoke <tt>getLastError()</tt> after every call. Default behaviour in version 2.7.2 of the MongoDB Java driver is that only network errors will cause the operation to fail, because the actual operation is executed asynchronously in the MongoDB server without holding up the client - to increase performance. The client can obtain the real result of the operation by explicitly invoking <tt>getLastError()</tt> on the <tt>WriteResult</tt> object returned or by setting the appropriate <tt>WriteConcern</tt>. If the backend operation has not finished yet, the client will block until the result is available. Setting this option to <tt>true</tt> will make the endpoint behave synchronously and return an Exception if the underlying operation failed. </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>writeConcern</tt> </td>
<td class='confluenceTd'> none (driver's default) </td>
<td class='confluenceTd'> Set a <tt>WriteConcern</tt> on the operation out of MongoDB's parameterised values. See <a href="http://api.mongodb.org/java/current/com/mongodb/WriteConcern.html#valueOf(java.lang.String)" class="external-link" rel="nofollow">WriteConcern.valueOf(String)</a>. </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>writeConcernRef</tt> </td>
<td class='confluenceTd'> none </td>
<td class='confluenceTd'> Sets a custom <tt>WriteConcern</tt> that exists in the Registry. Specify the bean name. </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>readPreference</tt> </td>
<td class='confluenceTd'> none </td>
<td class='confluenceTd'> Sets a <tt>ReadPreference</tt> on the connection. Accepted values: the name of any inner subclass of <a href="http://api.mongodb.org/java/current/com/mongodb/ReadPreference.html" class="external-link" rel="nofollow">ReadPreference</a>. For example: <tt>PrimaryReadPreference</tt>, <tt>SecondaryReadPreference</tt>, <tt>TaggedReadPreference</tt>. </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>dynamicity</tt> </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> If set to true, the endpoint will inspect the <tt>CamelMongoDbDatabase</tt> and <tt>CamelMongoDbCollection</tt> headers of the incoming message, and if any of them exists, the target collection and/or database will be overridden for that particular operation. Set to false by default to avoid triggering the lookup on every Exchange if the feature is not desired. </td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>persistentTailTracking</tt> </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Enables or disables persistent tail tracking for Tailable Cursor consumers. See below for more information. </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>persistentId</tt> </td>
<td class='confluenceTd'> none </td>
<td class='confluenceTd'> <b>Required if persistent tail tracking is enabled.</b> The id of this persistent tail tracker, to separate its records from the rest on the tail-tracking collection. </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>tailTrackingIncreasingField</tt> </td>
<td class='confluenceTd'> none </td>
<td class='confluenceTd'> <b>Required if persistent tail tracking is enabled.</b> Correlation field in the incoming record which is of increasing nature and will be used to position the tailing cursor every time it is generated. The cursor will be (re)created with a query of type: tailTrackIncreasingField &gt; lastValue (where lastValue is possibly recovered from persistent tail tracking). Can be of type Integer, Date, String, etc. NOTE: No support for dot notation at the current time, so the field should be at the top level of the document. </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>cursorRegenerationDelay</tt> </td>
<td class='confluenceTd'> 1000ms </td>
<td class='confluenceTd'> Establishes how long the endpoint will wait to regenerate the cursor after it has been killed by the MongoDB server (normal behaviour). </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>tailTrackDb</tt> </td>
<td class='confluenceTd'> same as endpoint's </td>
<td class='confluenceTd'> Database on which the persistent tail tracker will store its runtime information. </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>tailTrackCollection</tt> </td>
<td class='confluenceTd'> camelTailTracking </td>
<td class='confluenceTd'> Collection on which the persistent tail tracker will store its runtime information. </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>tailTrackField</tt> </td>
<td class='confluenceTd'> lastTrackingValue </td>
<td class='confluenceTd'> Field in which the persistent tail tracker will store the last tracked value. </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> <img class="emoticon" src="/confluence/images/icons/emoticons/check.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> </td>
</tr>
</tbody></table>
</div>


<h2><a name="MongoDB-MongoDBoperationsproducerendpoints"></a>MongoDB operations - producer endpoints</h2>
<h3><a name="MongoDB-Queryoperations"></a>Query operations</h3>
<h4><a name="MongoDB-findById"></a>findById</h4>

<p>This operation retrieves only one element from the collection whose _id field matches the content of the IN message body. The incoming object can be anything that has an equivalent to a BSON type. See <a href="http://bsonspec.org/#/specification" class="external-link" rel="nofollow">http://bsonspec.org/#/specification</a> and <a href="http://www.mongodb.org/display/DOCS/Java+Types" class="external-link" rel="nofollow">http://www.mongodb.org/display/DOCS/Java+Types</a>.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"direct:findById"</span>)
    .to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation&amp;operation=findById"</span>)
    .to(<span class="code-quote">"mock:resultFindById"</span>);
</pre>
</div></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Supports fields filter</b><br />This operation supports specifying a fields filter. See <a href="#MongoDB-FieldsFilter">Specifying a fields filter</a>.</td></tr></table></div>

<h4><a name="MongoDB-findOneByQuery"></a>findOneByQuery</h4>

<p>Use this operation to retrieve just one element from the collection that matches a MongoDB query. The query object is extracted from the IN message body, i.e. it should be of type <tt>DBObject</tt> or convertible to <tt>DBObject</tt>. See <a href="/confluence/pages/createpage.action?spaceKey=CAMEL&amp;title=Type+conversions&amp;linkCreation=true&amp;fromPageId=27838322" class="createlink">Type conversions</a>.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"direct:findOneByQuery"</span>)
    .to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation&amp;operation=findOneByQuery"</span>)
    .to(<span class="code-quote">"mock:resultFindOneByQuery"</span>);
</pre>
</div></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Supports fields filter</b><br />This operation supports specifying a fields filter. See <a href="#MongoDB-FieldsFilter">Specifying a fields filter</a>.</td></tr></table></div>

<h4><a name="MongoDB-findAll"></a>findAll</h4>

<p>The <tt>findAll</tt> operation returns all documents matching a query, or none at all, in which case all documents contained in the collection are returned.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"direct:findAll"</span>)
    .to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation=findAll"</span>)
    .to(<span class="code-quote">"mock:resultFindAll"</span>);
</pre>
</div></div>

<p>Paging and efficient retrieval is supported via the following headers:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header key </th>
<th class='confluenceTh'> Quick constant </th>
<th class='confluenceTh'> Description (extracted from MongoDB API doc) </th>
<th class='confluenceTh'> Expected type </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelMongoDbNumToSkip</tt> </td>
<td class='confluenceTd'> <tt>MongoDbConstants.NUM_TO_SKIP</tt> </td>
<td class='confluenceTd'> Discards a given number of elements at the beginning of the cursor. </td>
<td class='confluenceTd'> int/Integer </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelMongoDbLimit</tt> </td>
<td class='confluenceTd'> <tt>MongoDbConstants.LIMIT</tt> </td>
<td class='confluenceTd'> Limits the number of elements returned. </td>
<td class='confluenceTd'> int/Integer </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelMongoDbBatchSize</tt> </td>
<td class='confluenceTd'> <tt>MongoDbConstants.BATCH_SIZE</tt> </td>
<td class='confluenceTd'> Limits the number of elements returned in one batch. A cursor typically fetches a batch of result objects and store them locally. If batchSize is positive, it represents the size of each batch of objects retrieved. It can be adjusted to optimize performance and limit data transfer. If batchSize is negative, it will limit of number objects returned, that fit within the max batch size limit (usually 4MB), and cursor will be closed. For example if batchSize is -10, then the server will return a maximum of 10 documents and as many as can fit in 4MB, then close the cursor. Note that this feature is different from limit() in that documents must fit within a maximum size, and it removes the need to send a request to close the cursor server-side. The batch size can be changed even after a cursor is iterated, in which case the setting will apply on the next batch retrieval.</td>
<td class='confluenceTd'> int/Integer </td>
</tr>
</tbody></table>
</div>


<p>Additionally, you can set a sortBy criteria by putting the relevant <tt>DBObject</tt> describing your sorting in the <tt>CamelMongoDbSortBy</tt> header, quick constant: <tt>MongoDbConstants.SORT_BY</tt>.</p>

<p>The <tt>findAll</tt> operation will also return the following OUT headers to enable you to iterate through result pages if you are using paging:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header key </th>
<th class='confluenceTh'> Quick constant </th>
<th class='confluenceTh'> Description (extracted from MongoDB API doc) </th>
<th class='confluenceTh'> Data type </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelMongoDbResultTotalSize</tt> </td>
<td class='confluenceTd'> <tt>MongoDbConstants.RESULT_TOTAL_SIZE</tt> </td>
<td class='confluenceTd'> Number of objects matching the query. This does not take limit/skip into consideration. </td>
<td class='confluenceTd'> int/Integer </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelMongoDbResultPageSize</tt> </td>
<td class='confluenceTd'> <tt>MongoDbConstants.RESULT_PAGE_SIZE</tt> </td>
<td class='confluenceTd'> Number of objects matching the query. This does not take limit/skip into consideration. </td>
<td class='confluenceTd'> int/Integer </td>
</tr>
</tbody></table>
</div>


<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Supports fields filter</b><br />This operation supports specifying a fields filter. See <a href="#MongoDB-FieldsFilter">Specifying a fields filter</a>.</td></tr></table></div>

<p><a name="MongoDB-FieldsFilter"></a></p>
<h4><a name="MongoDB-Specifyingafieldsfilter"></a>Specifying a fields filter</h4>

<p>Query operations will, by default, return the matching objects in their entirety (with all their fields). If your documents are large and you only require retrieving a subset of their fields, you can specify a field filter in all query operations, simply by setting the relevant <tt>DBObject</tt> (or type convertible to <tt>DBObject</tt>, such as a JSON String, Map, etc.) on the <tt>CamelMongoDbFieldsFilter</tt> header, constant shortcut: <tt>MongoDbConstants.FIELDS_FILTER</tt>. </p>

<p>Here is an example that uses MongoDB's BasicDBObjectBuilder to simplify the creation of DBObjects. It retrieves all fields except <tt>_id</tt> and <tt>boringField</tt>:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-comment">// route: from(<span class="code-quote">"direct:findAll"</span>).to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation=findAll"</span>)
</span>DBObject fieldFilter = BasicDBObjectBuilder.start().add(<span class="code-quote">"_id"</span>, 0).add(<span class="code-quote">"boringField"</span>, 0).get();
<span class="code-object">Object</span> result = template.requestBodyAndHeader(<span class="code-quote">"direct:findAll"</span>, (<span class="code-object">Object</span>) <span class="code-keyword">null</span>, MongoDbConstants.FIELDS_FILTER, fieldFilter);
</pre>
</div></div>

<h3><a name="MongoDB-Create%2Fupdateoperations"></a>Create/update operations</h3>
<h4><a name="MongoDB-insert"></a>insert</h4>

<p>Inserts an new object into the MongoDB collection, taken from the IN message body. Type conversion is attempted to turn it into <tt>DBObject</tt> or a <tt>List</tt>.<br/>
Two modes are supported: single insert and multiple insert. For multiple insert, the endpoint will expect a List, Array or Collections of objects of any type, as long as they are - or can be converted to - <tt>DBObject</tt>. All objects are inserted at once. The endpoint will intelligently decide which backend operation to invoke (single or multiple insert) depending on the input.</p>

<p>Example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"direct:insert"</span>)
    .to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation=insert"</span>);
</pre>
</div></div>

<p>The operation will return a WriteResult, and depending on the <tt>WriteConcern</tt> or the value of the <tt>invokeGetLastError</tt> option, <tt>getLastError()</tt> would have been called already or not. If you want to access the ultimate result of the write operation, you need to retrieve the <tt>CommandResult</tt> by calling <tt>getLastError()</tt> or <tt>getCachedLastError()</tt> on the <tt>WriteResult</tt>. Then you can verify the result by calling <tt>CommandResult.ok()</tt>, <tt>CommandResult.getErrorMessage()</tt> and/or <tt>CommandResult.getException()</tt>.</p>

<p>Note that the new object's <tt>_id</tt> must be unique in the collection. If you don't specify the value, MongoDB will automatically generate one for you. But if you do specify it and it is not unique, the insert operation will fail (and for Camel to notice, you will need to enable invokeGetLastError or set a WriteConcern that waits for the write result). </p>

<p>This is not a limitation of the component, but it is how things work in MongoDB for higher throughput. If you are using a custom <tt>_id</tt>, you are expected to ensure at the application level that is unique (and this is a good practice too).</p>

<h4><a name="MongoDB-save"></a>save</h4>

<p>The save operation is equivalent to an <em>upsert</em> (UPdate, inSERT) operation, where the record will be updated, and if it doesn't exist, it will be inserted, all in one atomic operation. MongoDB will perform the matching based on the _id field.</p>

<p>Beware that in case of an update, the object is replaced entirely and the usage of <a href="http://www.mongodb.org/display/DOCS/Updating#Updating-ModifierOperations" class="external-link" rel="nofollow">MongoDB's $modifiers</a> is not permitted. Therefore, if you want to manipulate the object if it already exists, you have two options:</p>
<ol>
	<li>perform a query to retrieve the entire object first along with all its fields (may not be efficient), alter it inside Camel and then save it.</li>
	<li>use the update operation with <a href="http://www.mongodb.org/display/DOCS/Updating#Updating-ModifierOperations" class="external-link" rel="nofollow">$modifiers</a>, which will execute the update at the server-side instead. You can enable the upsert flag, in which case if an insert is required, MongoDB will apply the $modifiers to the filter query object and insert the result.</li>
</ol>


<p>For example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"direct:insert"</span>)
    .to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation=save"</span>);
</pre>
</div></div>

<h4><a name="MongoDB-update"></a>update</h4>

<p>Update one or multiple records on the collection. Requires a List&lt;DBObject&gt; as the IN message body containing exactly 2 elements:</p>
<ul>
	<li>Element 1 (index 0) =&gt; filter query =&gt; determines what objects will be affected, same as a typical query object</li>
	<li>Element 2 (index 1) =&gt; update rules =&gt; how matched objects will be updated. All <a href="http://www.mongodb.org/display/DOCS/Updating#Updating-ModifierOperations" class="external-link" rel="nofollow">modifier operations</a> from MongoDB are supported.</li>
</ul>


<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Multiupdates</b><br />By default, MongoDB will only update 1 object even if multiple objects match the filter query. To instruct MongoDB to update <b>all</b> matching records, set the <tt>CamelMongoDbMultiUpdate</tt> IN message header to <tt>true</tt>.</td></tr></table></div>

<p>A header with key <tt>CamelMongoDbRecordsAffected</tt> will be returned (<tt>MongoDbConstants.RECORDS_AFFECTED</tt> constant) with the number of records updated (copied from <tt>WriteResult.getN()</tt>).</p>

<p>Supports the following IN message headers:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header key </th>
<th class='confluenceTh'> Quick constant </th>
<th class='confluenceTh'> Description (extracted from MongoDB API doc) </th>
<th class='confluenceTh'> Expected type </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelMongoDbMultiUpdate</tt> </td>
<td class='confluenceTd'> <tt>MongoDbConstants.MULTIUPDATE</tt> </td>
<td class='confluenceTd'> If the update should be applied to all objects matching. See <a href="http://www.mongodb.org/display/DOCS/Atomic+Operations" class="external-link" rel="nofollow">http://www.mongodb.org/display/DOCS/Atomic+Operations</a> </td>
<td class='confluenceTd'> boolean/Boolean </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelMongoDbUpsert</tt> </td>
<td class='confluenceTd'> <tt>MongoDbConstants.UPSERT</tt> </td>
<td class='confluenceTd'> If the database should create the element if it does not exist </td>
<td class='confluenceTd'> boolean/Boolean </td>
</tr>
</tbody></table>
</div>


<p>For example, the following will update <b>all</b> records whose filterField field equals true by setting the value of the "scientist" field to "Darwin":</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-comment">// route: from(<span class="code-quote">"direct:update"</span>).to(<span class="code-quote">"mongodb:myDb?database=science&amp;collection=notableScientists&amp;operation=update"</span>);
</span>DBObject filterField = <span class="code-keyword">new</span> BasicDBObject(<span class="code-quote">"filterField"</span>, <span class="code-keyword">true</span>);
DBObject updateObj = <span class="code-keyword">new</span> BasicDBObject(<span class="code-quote">"$set"</span>, <span class="code-keyword">new</span> BasicDBObject(<span class="code-quote">"scientist"</span>, <span class="code-quote">"Darwin"</span>));
<span class="code-object">Object</span> result = template.requestBodyAndHeader(<span class="code-quote">"direct:update"</span>, <span class="code-keyword">new</span> <span class="code-object">Object</span>[] {filterField, updateObj}, MongoDbConstants.MULTIUPDATE, <span class="code-keyword">true</span>);
</pre>
</div></div>

<h3><a name="MongoDB-Deleteoperations"></a>Delete operations</h3>
<h4><a name="MongoDB-remove"></a>remove</h4>

<p>Remove matching records from the collection. The IN message body will act as the removal filter query, and is expected to be of type <tt>DBObject</tt> or a type convertible to it.<br/>
The following example will remove all objects whose field 'conditionField' equals true, in the science database, notableScientists collection:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-comment">// route: from(<span class="code-quote">"direct:remove"</span>).to(<span class="code-quote">"mongodb:myDb?database=science&amp;collection=notableScientists&amp;operation=remove"</span>);
</span>DBObject conditionField = <span class="code-keyword">new</span> BasicDBObject(<span class="code-quote">"conditionField"</span>, <span class="code-keyword">true</span>);
<span class="code-object">Object</span> result = template.requestBody(<span class="code-quote">"direct:remove"</span>, conditionField);
</pre>
</div></div>

<p>A header with key <tt>CamelMongoDbRecordsAffected</tt> is returned (<tt>MongoDbConstants.RECORDS_AFFECTED</tt> constant) with type <tt>int</tt>, containing the number of records deleted (copied from <tt>WriteResult.getN()</tt>).</p>

<h3><a name="MongoDB-Otheroperations"></a>Other operations</h3>
<h4><a name="MongoDB-count"></a>count</h4>

<p>Returns the total number of objects in a collection, returning a Long as the OUT message body.<br/>
The following example will count the number of records in the "dynamicCollectionName" collection. Notice how dynamicity is enabled, and as a result, the operation will not run against the "notableScientists" collection, but against the "dynamicCollectionName" collection.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-comment">// from(<span class="code-quote">"direct:count"</span>).to(<span class="code-quote">"mongodb:myDb?database=tickets&amp;collection=flights&amp;operation=count&amp;dynamicity=<span class="code-keyword">true</span>"</span>);
</span><span class="code-object">Long</span> result = template.requestBodyAndHeader(<span class="code-quote">"direct:count"</span>, <span class="code-quote">"irrelevantBody"</span>, MongoDbConstants.COLLECTION, <span class="code-quote">"dynamicCollectionName"</span>);
assertTrue(<span class="code-quote">"Result is not of type <span class="code-object">Long</span>"</span>, result <span class="code-keyword">instanceof</span> <span class="code-object">Long</span>);
</pre>
</div></div>

<h4><a name="MongoDB-getDbStats"></a>getDbStats</h4>
<p>Equivalent of running the <tt>db.stats()</tt> command in the MongoDB shell, which displays useful statistic figures about the database.<br/>
For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&gt; db.stats();
{
	<span class="code-quote">"db"</span> : <span class="code-quote">"test"</span>,
	<span class="code-quote">"collections"</span> : 7,
	<span class="code-quote">"objects"</span> : 719,
	<span class="code-quote">"avgObjSize"</span> : 59.73296244784423,
	<span class="code-quote">"dataSize"</span> : 42948,
	<span class="code-quote">"storageSize"</span> : 1000058880,
	<span class="code-quote">"numExtents"</span> : 9,
	<span class="code-quote">"indexes"</span> : 4,
	<span class="code-quote">"indexSize"</span> : 32704,
	<span class="code-quote">"fileSize"</span> : 1275068416,
	<span class="code-quote">"nsSizeMB"</span> : 16,
	<span class="code-quote">"ok"</span> : 1
}
</pre>
</div></div>

<p>Usage example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-comment">// from(<span class="code-quote">"direct:getDbStats"</span>).to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation=getDbStats"</span>);
</span><span class="code-object">Object</span> result = template.requestBody(<span class="code-quote">"direct:getDbStats"</span>, <span class="code-quote">"irrelevantBody"</span>);
assertTrue(<span class="code-quote">"Result is not of type DBObject"</span>, result <span class="code-keyword">instanceof</span> DBObject);
</pre>
</div></div>

<p>The operation will return a data structure similar to the one displayed in the shell, in the form of a <tt>DBObject</tt> in the OUT message body. </p>

<h4><a name="MongoDB-getColStats"></a>getColStats</h4>
<p>Equivalent of running the <tt>db.collection.stats()</tt> command in the MongoDB shell, which displays useful statistic figures about the collection.<br/>
For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&gt; db.camelTest.stats();
{
	<span class="code-quote">"ns"</span> : <span class="code-quote">"test.camelTest"</span>,
	<span class="code-quote">"count"</span> : 100,
	<span class="code-quote">"size"</span> : 5792,
	<span class="code-quote">"avgObjSize"</span> : 57.92,
	<span class="code-quote">"storageSize"</span> : 20480,
	<span class="code-quote">"numExtents"</span> : 2,
	<span class="code-quote">"nindexes"</span> : 1,
	<span class="code-quote">"lastExtentSize"</span> : 16384,
	<span class="code-quote">"paddingFactor"</span> : 1,
	<span class="code-quote">"flags"</span> : 1,
	<span class="code-quote">"totalIndexSize"</span> : 8176,
	<span class="code-quote">"indexSizes"</span> : {
		<span class="code-quote">"_id_"</span> : 8176
	},
	<span class="code-quote">"ok"</span> : 1
}
</pre>
</div></div>

<p>Usage example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-comment">// from(<span class="code-quote">"direct:getColStats"</span>).to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation=getColStats"</span>);
</span><span class="code-object">Object</span> result = template.requestBody(<span class="code-quote">"direct:getColStats"</span>, <span class="code-quote">"irrelevantBody"</span>);
assertTrue(<span class="code-quote">"Result is not of type DBObject"</span>, result <span class="code-keyword">instanceof</span> DBObject);
</pre>
</div></div>

<p>The operation will return a data structure similar to the one displayed in the shell, in the form of a <tt>DBObject</tt> in the OUT message body. </p>

<h3><a name="MongoDB-Dynamicoperations"></a>Dynamic operations</h3>

<p>An Exchange can override the endpoint's fixed operation by setting the <tt>CamelMongoDbOperation</tt> header, defined by the <tt>MongoDbConstants.OPERATION_HEADER</tt> constant.<br/>
The values supported are determined by the MongoDbOperation enumeration and match the accepted values for the <tt>operation</tt> parameter on the endpoint URI.</p>

<p>For example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-comment">// from(<span class="code-quote">"direct:insert"</span>).to(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=tickets&amp;operation=insert"</span>);
</span><span class="code-object">Object</span> result = template.requestBodyAndHeader(<span class="code-quote">"direct:insert"</span>, <span class="code-quote">"irrelevantBody"</span>, MongoDbConstants.OPERATION_HEADER, <span class="code-quote">"count"</span>);
assertTrue(<span class="code-quote">"Result is not of type <span class="code-object">Long</span>"</span>, result <span class="code-keyword">instanceof</span> <span class="code-object">Long</span>);
</pre>
</div></div>

<h2><a name="MongoDB-TailableCursorConsumer"></a>Tailable Cursor Consumer</h2>

<p>MongoDB offers a mechanism to instantaneously consume ongoing data from a collection, by keeping the cursor open just like the <tt>tail -f</tt> command of *nix systems. This mechanism is significantly more efficient than a scheduled poll, due to the fact that the server pushes new data to the client as it becomes available, rather than making the client ping back at scheduled intervals to fetch new data. It also reduces otherwise redundant network traffic.</p>

<p>There is only one requisite to use tailable cursors: the collection must be a "capped collection", meaning that it will only hold N objects, and when the limit is reached, MongoDB flushes old objects in the same order they were originally inserted. For more information, please refer to: <a href="http://www.mongodb.org/display/DOCS/Tailable+Cursors" class="external-link" rel="nofollow">http://www.mongodb.org/display/DOCS/Tailable+Cursors</a>. </p>

<p>The Camel MongoDB component implements a tailable cursor consumer, making this feature available for you to use in your Camel routes. As new objects are inserted, MongoDB will push them as DBObjects in natural order to your tailable cursor consumer, who will transform them to an Exchange and will trigger your route logic.</p>

<h3><a name="MongoDB-Howthetailablecursorconsumerworks"></a>How the tailable cursor consumer works</h3>

<p>To turn a cursor into a tailable cursor, a few special flags are to be signalled to MongoDB when first generating the cursor. Once created, the cursor will then stay open and will block upon calling the <tt>DBCursor.next()</tt> method until new data arrives. However, the MongoDB server reserves itself the right to kill your cursor if new data doesn't appear after an indeterminate period. If you are interested to continue consuming new data, you have to regenerate the cursor. And to do so, you will have to remember the position where you left off or else you will start consuming from the top again. </p>

<p>The Camel MongoDB tailable cursor consumer takes care of all these tasks for you. You will just need to provide the key to some field in your data of increasing nature, which will act as a marker to position your cursor every time it is regenerated, e.g. a timestamp, a sequential ID, etc. It can be of any datatype supported by MongoDB. Date, Strings and Integers are found to work well. We call this mechanism "tail tracking" in the context of this component.</p>

<p>The consumer will remember the last value of this field and whenever the cursor is to be regenerated, it will run the query with a filter like: <tt>increasingField &gt; lastValue</tt>, so that only unread data is consumed.</p>

<p><b>Setting the increasing field:</b> Set the key of the increasing field on the endpoint URI <tt>tailTrackingIncreasingField</tt> option. In Camel 2.10, it must be a top-level field in your data, as nested navigation for this field is not yet supported. That is, the "timestamp" field is okay, but "nested.timestamp" will not work. Please open a ticket in the Camel JIRA if you do require support for nested increasing fields.</p>

<p><b>Cursor regeneration delay:</b> One thing to note is that if new data is not already available upon initialisation, MongoDB will kill the cursor instantly. Since we don't want to overwhelm the server in this case, a <tt>cursorRegenerationDelay</tt> option has been introduced (with a default value of 1000ms.), which you can modify to suit your needs.</p>

<p>An example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=cancellations&amp;tailTrackIncreasingField=departureTime"</span>)
    .id(<span class="code-quote">"tailableCursorConsumer1"</span>)
    .autoStartup(<span class="code-keyword">false</span>)
    .to(<span class="code-quote">"mock:test"</span>);
</pre>
</div></div>

<p>The above route will consume from the "flights.cancellations" capped collection, using "departureTime" as the increasing field, with a default regeneration cursor delay of 1000ms.</p>

<h3><a name="MongoDB-Persistenttailtracking"></a>Persistent tail tracking</h3>

<p>Standard tail tracking is volatile and the last value is only kept in memory. However, in practice you will need to restart your Camel container every now and then, but your last value would then be lost and your tailable cursor consumer would start consuming from the top again, very likely sending duplicate records into your route.</p>

<p>To overcome this situation, you can enable the <b>persistent tail tracking</b> feature to keep track of the last consumed increasing value in a special collection inside your MongoDB database too. When the consumer initialises again, it will restore the last tracked value and continue as if nothing happened.</p>

<p>The last read value is persisted on two occasions: every time the cursor is regenerated and when the consumer shuts down. We may consider persisting at regular intervals too in the future (flush every 5 seconds) for added robustness if the demand is there. To request this feature, please open a ticket in the Camel JIRA.</p>

<h3><a name="MongoDB-Enablingpersistenttailtracking"></a>Enabling persistent tail tracking</h3>

<p>To enable this function, set at least the following options on the endpoint URI:</p>
<ul>
	<li><tt>persistentTailTracking</tt> option to <tt>true</tt></li>
	<li><tt>persistentId</tt> option to a unique identifier for this consumer, so that the same collection can be reused across many consumers</li>
</ul>


<p>Additionally, you can set the <tt>tailTrackDb</tt>, <tt>tailTrackCollection</tt> and <tt>tailTrackField</tt> options to customise where the runtime information will be stored. Refer to the endpoint options table at the top of this page for descriptions of each option.</p>

<p>For example, the following route will consume from the "flights.cancellations" capped collection, using "departureTime" as the increasing field, with a default regeneration cursor delay of 1000ms, with persistent tail tracking turned on, and persisting under the "cancellationsTracker" id on the "flights.camelTailTracking", storing the last processed value under the "lastTrackingValue" field (<tt>camelTailTracking</tt> and <tt>lastTrackingValue</tt> are defaults).</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=cancellations&amp;tailTrackIncreasingField=departureTime&amp;persistentTailTracking=<span class="code-keyword">true</span>&amp;persistentId=cancellationsTracker"</span>)
	.id(<span class="code-quote">"tailableCursorConsumer2"</span>)
	.autoStartup(<span class="code-keyword">false</span>)
	.to(<span class="code-quote">"mock:test"</span>);
</pre>
</div></div>

<p>Below is another example identical to the one above, but where the persistent tail tracking runtime information will be stored under the "trackers.camelTrackers" collection, in the "lastProcessedDepartureTime" field:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"mongodb:myDb?database=flights&amp;collection=cancellations&amp;tailTrackIncreasingField=departureTime&amp;persistentTailTracking=<span class="code-keyword">true</span>&amp;persistentId=cancellationsTracker&amp;tailTrackDb=trackers"</span> + <span class="code-quote">"&amp;tailTrackCollection=camelTrackers&amp;tailTrackField=lastProcessedDepartureTime"</span>)
	.id(<span class="code-quote">"tailableCursorConsumer3"</span>)
	.autoStartup(<span class="code-keyword">false</span>)
	.to(<span class="code-quote">"mock:test"</span>);
</pre>
</div></div>

<h2><a name="MongoDB-Typeconversions"></a>Type conversions</h2>

<p>The <tt>MongoDbBasicConverters</tt> type converter included with the camel-mongodb component provides the following conversions:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> From type </th>
<th class='confluenceTh'> To type </th>
<th class='confluenceTh'> How? </th>
</tr>
<tr>
<td class='confluenceTd'> fromMapToDBObject </td>
<td class='confluenceTd'> <tt>Map</tt> </td>
<td class='confluenceTd'> <tt>DBObject</tt> </td>
<td class='confluenceTd'> constructs a new <tt>BasicDBObject</tt> via the <tt>new BasicDBObject(Map m)</tt> constructor </td>
</tr>
<tr>
<td class='confluenceTd'> fromBasicDBObjectToMap </td>
<td class='confluenceTd'> <tt>BasicDBObject</tt> </td>
<td class='confluenceTd'> <tt>Map</tt> </td>
<td class='confluenceTd'> <tt>BasicDBObject</tt> already implements <tt>Map</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> fromStringToDBObject </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <tt>DBObject</tt> </td>
<td class='confluenceTd'> uses <tt>com.mongodb.util.JSON.parse(String s)</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> fromAnyObjectToDBObject </td>
<td class='confluenceTd'> <tt>Object</tt> </td>
<td class='confluenceTd'> <tt>DBObject</tt> </td>
<td class='confluenceTd'> uses the <a href="http://jackson.codehaus.org/" class="external-link" rel="nofollow">Jackson library</a> to convert the object to a <tt>Map</tt>, which is in turn used to initialise a new <tt>BasicDBObject</tt> </td>
</tr>
</tbody></table>
</div>


<p>This type converter is auto-discovered, so you don't need to configure anything manually.</p>

<h2><a name="MongoDB-Seealso"></a>See also</h2>

<ul>
	<li><a href="http://www.mongodb.org/" class="external-link" rel="nofollow">MongoDB website</a></li>
	<li><a href="http://en.wikipedia.org/wiki/NoSQL" class="external-link" rel="nofollow">NoSQL Wikipedia article</a></li>
	<li><a href="http://api.mongodb.org/java/current/" class="external-link" rel="nofollow">MongoDB Java driver API docs - current version</a></li>
	<li><a href="http://svn.apache.org/viewvc/camel/trunk/components/camel-mongodb/src/test/" class="external-link" rel="nofollow">Unit tests</a> for more examples of usage</li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/MongoDB">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27838322&revisedVersion=25&originalVersion=24">View Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/MongoDB?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message