You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

419 lines
13 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Mongo &#8594; services mongo :: Swarmlab faq</title>
<link rel="canonical" href="http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs/swarmlab_poc-datacollector/docs/index-mongo.html">
<meta name="generator" content="Antora 2.3.4">
<link rel="stylesheet" href="../../_/css/site.css">
<link rel="stylesheet" href="../../_/css/search.css">
<script>var uiRootPath = '../../_'</script>
</head>
<body class="article">
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs">Swarmlab faq</a>
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="#">Home</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Products</a>
<div class="navbar-dropdown">
<a class="navbar-item" target ="hybridgit" href="https://git.swarmlab.io:3000/zeus/swarmlab-hybrid">Hybrid</a>
<a class="navbar-item" target ="venusgit" href="https://git.swarmlab.io:3000/swarmlab/venus-client">Venus</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Services</a>
<div class="navbar-dropdown">
<a class="navbar-item" target ="hybrid" href="https://api-client.swarmlab.io:8088/">Hybrid</a>
<a class="navbar-item" target ="venus" href="https://api-client.swarmlab.io:8088/">Venus</a>
</div>
</div>
<div class="navbar-item">
<input id="search-input" type="text" placeholder="Search docs">
</div>
</div>
</div>
</nav>
</header>
<div class="body">
<div class="nav-container" data-component="swarmlab_poc-datacollector" data-version="docs">
<aside class="nav">
<div class="panels">
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
<h3 class="title"><a href="index.html">swarmlab_poc-datacollector</a></h3>
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="index.html">datacollector</a>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="index-structure.html">project structure</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="index-vuejs.html">Vue.JS</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="index-nodejs.html">Node JS</a>
</li>
<li class="nav-item is-current-page" data-depth="2">
<a class="nav-link" href="index-mongo.html">Mongo</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="index-redis.html">Redis</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="index-src.html">src-files</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="doc-dummy_service.html">dummy_service</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="doc-readmongo_service.html">readmongo_service</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="index-usage.html">Usage</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="index-dummy_service.html">dummy_service</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="index-microservice.html">Add Microservice</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
<div class="context">
<span class="title">swarmlab_poc-datacollector</span>
<span class="version">docs</span>
</div>
<ul class="components">
<li class="component">
<a class="title" href="../../CloudComputing_Lab/docs/index.html">CloudComputing_Lab</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../CloudComputing_Lab/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_faq/docs/index.html">swarmlab_faq</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_faq/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_how-to-build-a-Swarmlab-service/docs/index.html">swarmlab_how-to-build-a-Swarmlab-service</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_how-to-build-a-Swarmlab-service/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_infrastructure-as-code/docs/index.html">swarmlab_infrastructure-as-code</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_infrastructure-as-code/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_iot-sensor-node/docs/index.html">swarmlab_iot-sensor-node</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_iot-sensor-node/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_network-adhoc/docs/index.html">swarmlab_network-adhoc</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_network-adhoc/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component is-current">
<a class="title" href="index.html">swarmlab_poc-datacollector</a>
<ul class="versions">
<li class="version is-current is-latest">
<a href="index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_raspi-docker/docs/index.html">swarmlab_raspi-docker</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_raspi-docker/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_sec-intro/docs/index.html">swarmlab_sec-intro</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_sec-intro/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_sec-iptables/docs/index.html">swarmlab_sec-iptables</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_sec-iptables/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_sec-ssh-tunneling/docs/index.html">swarmlab_sec-ssh-tunneling</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_sec-ssh-tunneling/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_sidecar-firefox/docs/index.html">swarmlab_sidecar-firefox</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_sidecar-firefox/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_tech-list/docs/index.html">swarmlab_tech-list</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_tech-list/docs/index.html">docs</a>
</li>
</ul>
</li>
<li class="component">
<a class="title" href="../../swarmlab_xelatex-thesis/docs/index.html">swarmlab_xelatex-thesis</a>
<ul class="versions">
<li class="version is-latest">
<a href="../../swarmlab_xelatex-thesis/docs/index.html">docs</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main class="article">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="../../swarmlab_faq/docs/index.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ul>
<li><a href="index.html">swarmlab_poc-datacollector</a></li>
<li><a href="index-structure.html">project structure</a></li>
<li><a href="index-mongo.html">Mongo</a></li>
</ul>
</nav>
</div>
<div class="content">
<aside class="toc sidebar" data-title="Contents" data-levels="2">
<div class="toc-menu"></div>
</aside>
<article class="doc">
<h1 class="page">Mongo &#8594; services mongo</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><strong>MongoDB</strong> is a document database with the scalability and flexibility that you want with the querying and indexing that you need</p>
</div>
<div class="paragraph">
<p>Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas.
MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License (SSPL).</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_main_features"><a class="anchor" href="#_main_features"></a>Main features</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>Ad-hoc queries</p>
<div class="ulist">
<ul>
<li>
<p>MongoDB supports field, range query, and regular-expression searches.</p>
</li>
</ul>
</div>
</li>
<li>
<p>Indexing</p>
<div class="ulist">
<ul>
<li>
<p>Fields in a MongoDB document can be indexed with primary and secondary indices or index.</p>
</li>
</ul>
</div>
</li>
<li>
<p>Replication</p>
<div class="ulist">
<ul>
<li>
<p>MongoDB provides high availability with replica sets.</p>
</li>
</ul>
</div>
</li>
<li>
<p>Load balancing</p>
<div class="ulist">
<ul>
<li>
<p>MongoDB scales horizontally using sharding.</p>
</li>
</ul>
</div>
</li>
<li>
<p>File storage</p>
<div class="ulist">
<ul>
<li>
<p>MongoDB can be used as a file system, called GridFS, with load balancing and data replication features over multiple machines for storing files.</p>
</li>
</ul>
</div>
</li>
<li>
<p>Aggregation</p>
<div class="ulist">
<ul>
<li>
<p>MongoDB provides three ways to perform aggregation: the aggregation pipeline, the map-reduce function, and single-purpose aggregation methods.</p>
</li>
<li>
<p>Map-reduce can be used for batch processing of data and aggregation operations.</p>
</li>
</ul>
</div>
</li>
<li>
<p>Server-side JavaScript execution</p>
<div class="ulist">
<ul>
<li>
<p>JavaScript can be used in queries, aggregation functions (such as MapReduce), and sent directly to the database to be executed.</p>
</li>
</ul>
</div>
</li>
<li>
<p>Capped collections</p>
<div class="ulist">
<ul>
<li>
<p>MongoDB supports fixed-size collections called capped collections. This type of collection maintains insertion order and, once the specified size has been reached, behaves like a circular queue.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>Doc origin <a href="https://en.wikipedia.org/wiki/MongoDB#Main_features">wikipedia</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_replication_in_mongodb"><a class="anchor" href="#_replication_in_mongodb"></a>Replication in MongoDB</h2>
<div class="sectionbody">
<div class="literalblock">
<div class="content">
<pre>replica set is a group of mongod instances that maintain the same data set. A replica set contains several data bearing nodes and optionally one arbiter node.</pre>
</div>
</div>
<div class="imageblock right">
<div class="content">
<img src="_images/replica-set-primary-with-two-secondaries.bakedsvg.svg" alt="replica set primary with two secondaries.bakedsvg">
</div>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<a href="http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs/swarmlab/docs/hybrid/start-storage.html" target="_blank" rel="noopener">swarmlab provide storage options</a>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="_video_intro"><a class="anchor" href="#_video_intro"></a>Video = intro</h3>
<div class="sidebarblock">
<div class="content">
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
Mongo in 100 Seconds
</td>
</tr>
</table>
</div>
<div class="videoblock">
<div class="content">
<iframe src="https://www.youtube.com/embed/-bt_y4Loofg?rel=0" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</main>
</div>
<footer class="footer">
<p>This page was built using the Antora <a href="https://gitlab.com/antora/antora-ui-default" target="antora">default UI</a> </p>
</footer>
<script src="../../_/js/site.js"></script>
<script src="../../_/js/vendor/lunr.js"></script>
<script src="../../_/js/vendor/search.js" id="search-script" data-base-path="../.." data-page-path="/swarmlab_poc-datacollector/docs/index-mongo.html"></script>
<script async src="../../_/../search-index.js"></script>
<script async src="../../_/js/vendor/highlight.js"></script>
</body>
</html>