Commit 5533f4a2 authored by illo's avatar illo
Browse files

update docs

parent f8f84b7b
Pipeline #233374445 passed with stage
in 20 seconds
......@@ -64,7 +64,7 @@
<a href="#mongopipe" class="anchor"></a>mongopipe</h1></div>
<!-- badges: start -->
<p>The goal of mongopipe is to have a simple translator for R code into json based queries for Mongodb. This package could be seen as an addon for mongolite.</p>
<p>The goal of mongopipe is to have a simple translator for R code into json based queries for Mongodb.</p>
<div id="installation" class="section level2">
<h2 class="hasAnchor">
<a href="#installation" class="anchor"></a>Installation</h2>
......@@ -112,44 +112,45 @@
<span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">result</span><span class="op">)</span>
<span class="co">#&gt; _id air_time dep_delay origin</span>
<span class="co">#&gt; 1 5fe1ea0292c746099b20fac1 230 -6 JFK</span>
<span class="co">#&gt; 2 5fe1ea0292c746099b20fac1 238 9 JFK</span>
<span class="co">#&gt; 3 5fe1ea0292c746099b20fac1 251 -6 JFK</span>
<span class="co">#&gt; 4 5fe1ea0292c746099b20fac1 257 16 JFK</span>
<span class="co">#&gt; 5 5fe1ea0292c746099b20fac1 242 0 JFK</span>
<span class="co">#&gt; 6 5fe1ea0292c746099b20fac1 240 -2 JFK</span></code></pre></div>
<span class="co">#&gt; 1 5fe1f43f0d014e38242e1401 230 -6 JFK</span>
<span class="co">#&gt; 2 5fe1f43f0d014e38242e1401 238 9 JFK</span>
<span class="co">#&gt; 3 5fe1f43f0d014e38242e1401 251 -6 JFK</span>
<span class="co">#&gt; 4 5fe1f43f0d014e38242e1401 257 16 JFK</span>
<span class="co">#&gt; 5 5fe1f43f0d014e38242e1401 242 0 JFK</span>
<span class="co">#&gt; 6 5fe1f43f0d014e38242e1401 240 -2 JFK</span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="reference/mongopipe.html">mongopipe</a></span><span class="op">(</span><span class="op">)</span> <span class="op">%&gt;%</span>
<code class="sourceCode R"><span class="va">pipe</span> <span class="op">&lt;-</span> <span class="fu"><a href="reference/mongopipe.html">mongopipe</a></span><span class="op">(</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="reference/match.html">match</a></span><span class="op">(</span>faa<span class="op">=</span><span class="st">"ABQ"</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="reference/match.html">lookup</a></span><span class="op">(</span>from <span class="op">=</span> <span class="st">"test_flights"</span>, local_field <span class="op">=</span> <span class="st">"faa"</span>, foreign_field <span class="op">=</span> <span class="st">"dest"</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="reference/match.html">unwind</a></span><span class="op">(</span>field <span class="op">=</span> <span class="st">"test_flights"</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="reference/match.html">project</a></span><span class="op">(</span>air_time<span class="op">=</span><span class="st">"$test_flights.air_time"</span>, dep_delay<span class="op">=</span><span class="st">"$test_flights.dep_delay"</span>, origin<span class="op">=</span><span class="st">"$test_flights.origin"</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">pipe</span>, pretty <span class="op">=</span> <span class="fl">4</span><span class="op">)</span>
<span class="co">#&gt; [</span>
<span class="co">#&gt; {</span>
<span class="co">#&gt; "$match": {</span>
<span class="co">#&gt; "faa": "ABQ"</span>
<span class="co">#&gt; }</span>
<span class="co">#&gt; },</span>
<span class="co">#&gt; {</span>
<span class="co">#&gt; "$lookup": {</span>
<span class="co">#&gt; "from": "test_flights",</span>
<span class="co">#&gt; "localField": "faa",</span>
<span class="co">#&gt; "foreignField": "dest",</span>
<span class="co">#&gt; "as": "test_flights"</span>
<span class="co">#&gt; }</span>
<span class="co">#&gt; },</span>
<span class="co">#&gt; {</span>
<span class="co">#&gt; "$unwind": "$test_flights"</span>
<span class="co">#&gt; },</span>
<span class="co">#&gt; {</span>
<span class="co">#&gt; "$project": {</span>
<span class="co">#&gt; "air_time": "$test_flights.air_time",</span>
<span class="co">#&gt; "dep_delay": "$test_flights.dep_delay",</span>
<span class="co">#&gt; "origin": "$test_flights.origin"</span>
<span class="co">#&gt; {</span>
<span class="co">#&gt; "$match": {</span>
<span class="co">#&gt; "faa": "ABQ"</span>
<span class="co">#&gt; }</span>
<span class="co">#&gt; },</span>
<span class="co">#&gt; {</span>
<span class="co">#&gt; "$lookup": {</span>
<span class="co">#&gt; "from": "test_flights",</span>
<span class="co">#&gt; "localField": "faa",</span>
<span class="co">#&gt; "foreignField": "dest",</span>
<span class="co">#&gt; "as": "test_flights"</span>
<span class="co">#&gt; }</span>
<span class="co">#&gt; },</span>
<span class="co">#&gt; {</span>
<span class="co">#&gt; "$unwind": "$test_flights"</span>
<span class="co">#&gt; },</span>
<span class="co">#&gt; {</span>
<span class="co">#&gt; "$project": {</span>
<span class="co">#&gt; "air_time": "$test_flights.air_time",</span>
<span class="co">#&gt; "dep_delay": "$test_flights.dep_delay",</span>
<span class="co">#&gt; "origin": "$test_flights.origin"</span>
<span class="co">#&gt; }</span>
<span class="co">#&gt; }</span>
<span class="co">#&gt; }</span>
<span class="co">#&gt; ]</span>
<span class="co">#&gt; [{"$match":{"faa":"ABQ"}},{"$lookup":{"from":"test_flights","localField":"faa","foreignField":"dest","as":"test_flights"}},{"$unwind":"$test_flights"},{"$project":{"air_time":"$test_flights.air_time","dep_delay":"$test_flights.dep_delay","origin":"$test_flights.origin"}}]</span></code></pre></div>
<span class="co">#&gt; ]</span></code></pre></div>
</div>
</div>
</div>
......
......@@ -2,5 +2,5 @@ pandoc: 2.7.3
pkgdown: 1.6.1
pkgdown_sha: ~
articles: {}
last_built: 2020-12-22T13:24Z
last_built: 2020-12-22T14:42Z
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment