all repos — litestore @ 25332dab65c393245545c4cd49442c37991d37be

A minimalist nosql document store.

Documentation: Usage chapter.
h3rald h3rald@h3rald.com
Sun, 03 May 2015 20:24:52 +0200
commit

25332dab65c393245545c4cd49442c37991d37be

parent

bea532e5a3f8ec83dfce83d4def767ec7db7e199

3 files changed, 133 insertions(+), 3 deletions(-)

jump to
M admin/LiteStore_UserGuide.htmadmin/LiteStore_UserGuide.htm

@@ -111,7 +111,12 @@ </ul>

</li> <li><a href="#Usage">Usage</a> <ul> - <li><a href="#Command.Line.Syntax">Command Line Syntax</a></li> + <li><a href="#Command.Line.Syntax">Command Line Syntax</a> + <ul> + <li><a href="#Commands">Commands</a></li> + <li><a href="#Options">Options</a></li> + </ul> + </li> <li><a href="#Examples">Examples</a> <ul> <li><a href="#Starting.the.HTTP.Server">Starting the HTTP Server</a></li>

@@ -306,17 +311,84 @@ <h2 id="Usage">Usage<a href="#document-top" title="Go to top"></a></h2>

<h3 id="Command.Line.Syntax">Command Line Syntax<a href="#document-top" title="Go to top"></a></h3> +<p><span class="kwd">litestore</span> <strong>[</strong> <em>command</em> <strong>]</strong> <strong>[</strong> <em>option1</em>, <em>option2</em>, &hellip; <strong>]</strong></p> + +<h4 id="Commands">Commands<a href="#document-top" title="Go to top"></a></h4> + +<ul> +<li><strong>run</strong> &mdash; Start LiteStore server (default if no command specified).</li> +<li><strong>delete</strong> &mdash; Delete a previously-imported specified directory (requires -d).</li> +<li><strong>import</strong> &mdash; Import the specified directory into the datastore (requires -d).</li> +<li><strong>export</strong> &mdash; Export the previously-imported specified directory to the current directory (requires -d).</li> +<li><strong>optimize</strong> &mdash; Optimize search indexes.</li> +<li><strong>vacuum</strong> &mdash; Vacuum datastore.</li> +</ul> + + +<h4 id="Options">Options<a href="#document-top" title="Go to top"></a></h4> + +<ul> +<li><strong>-a</strong>, <strong>--address</strong> &mdash; Specify server address (default: 127.0.0.1).</li> +<li><strong>-d</strong>, <strong>--directory</strong> &mdash; Specify a directory to import, export, delete, or mount.</li> +<li><strong>-h</strong>, <strong>--help</strong> &mdash; Display program usage.</li> +<li><strong>-l</strong>, <strong>--log</strong> &mdash; Specify the log level: debug, info, warn, error, none (default: info)</li> +<li><strong>-m</strong>, <strong>--mount</strong> &mdash; Mirror database changes to the specified directory on the filesystem.</li> +<li><strong>-p</strong>, <strong>--port</strong> &mdash;Specify server port number (default: 9500).</li> +<li><strong>-r</strong>, <strong>--readonly</strong> &mdash; Allow only data retrieval operations.</li> +<li><strong>-s</strong>, <strong>--store</strong> &mdash; Specify a datastore file (default: data.db)</li> +<li><strong>-v</strong>, <strong>--version</strong> &mdash; Display the program version.</li> +</ul> + + <h3 id="Examples">Examples<a href="#document-top" title="Go to top"></a></h3> <h4 id="Starting.the.HTTP.Server">Starting the HTTP Server<a href="#document-top" title="Go to top"></a></h4> +<ul> +<li><p>with default settings:</p> + +<p><span class="cmd">litestore</span></p></li> +<li><p>with custom port (<strong>9700</strong>) and address (<strong>0.0.0.0</strong>):</p> + +<p><span class="cmd">litestore -p:9700 -a:0.0.0.0</span></p></li> +<li><p>in read-only mode with logging level set to <strong>debug</strong>:</p> + +<p><span class="cmd">litestore -r -l:debug</span></p></li> +<li><p>mouting a directory called <strong>admin</strong> (changes will be mirrored to filesystem):</p> + +<p><span class="cmd">litestore -m:admin</span></p></li> +</ul> + + <h4 id="Importing.a.directory">Importing a directory<a href="#document-top" title="Go to top"></a></h4> +<p>Import a directory called <strong>admin</strong>:</p> + +<p><span class="cmd">litestore import -d:admin</span></p> + <h4 id="Exporting.a.directory">Exporting a directory<a href="#document-top" title="Go to top"></a></h4> +<p>Export all documents tagged with <strong>$dir:admin</strong> to a local directory called <strong>admin</strong>:</p> + +<p><span class="cmd">litestore -e:admin</span></p> + <h4 id="Deleting.documents.within.a.directory">Deleting documents within a directory<a href="#document-top" title="Go to top"></a></h4> +<p>Delete all documents tagged with <strong>$dir:admin</strong>:</p> + +<p><span class="cmd">litestore -d:admin</span></p> + <h4 id="Performing.maintenance.operations">Performing maintenance operations<a href="#document-top" title="Go to top"></a></h4> + +<ul> +<li><p>vacuum:</p> + +<p><span class="cmd">litestore vacuum</span></p></li> +<li><p>optimize search index:</p> + +<p><span class="cmd">litestore optimize</span></p></li> +</ul> + <h2 id="REST.API.Reference">REST API Reference<a href="#document-top" title="Go to top"></a></h2>
M admin/md/usage.mdadmin/md/usage.md

@@ -2,14 +2,72 @@ ## Usage

### Command Line Syntax +[litestore](class:kwd) **[** _command_ **]** **[** _option1_, _option2_, ... **]** + +#### Commands + +* **run** &mdash; Start LiteStore server (default if no command specified). +* **delete** &mdash; Delete a previously-imported specified directory (requires -d). +* **import** &mdash; Import the specified directory into the datastore (requires -d). +* **export** &mdash; Export the previously-imported specified directory to the current directory (requires -d). +* **optimize** &mdash; Optimize search indexes. +* **vacuum** &mdash; Vacuum datastore. + +#### Options + +* **-a**, **-\-address** &mdash; Specify server address (default: 127.0.0.1). +* **-d**, **-\-directory** &mdash; Specify a directory to import, export, delete, or mount. +* **-h**, **-\-help** &mdash; Display program usage. +* **-l**, **-\-log** &mdash; Specify the log level: debug, info, warn, error, none (default: info) +* **-m**, **-\-mount** &mdash; Mirror database changes to the specified directory on the filesystem. +* **-p**, **-\-port** &mdash;Specify server port number (default: 9500). +* **-r**, **-\-readonly** &mdash; Allow only data retrieval operations. +* **-s**, **-\-store** &mdash; Specify a datastore file (default: data.db) +* **-v**, **-\-version** &mdash; Display the program version. + ### Examples #### Starting the HTTP Server +* with default settings: + + [litestore](class:cmd) +* with custom port (**9700**) and address (**0.0.0.0**): + + [litestore -p:9700 -a:0.0.0.0](class:cmd) + +* in read-only mode with logging level set to **debug**: + + [litestore -r -l:debug](class:cmd) + +* mouting a directory called **admin** (changes will be mirrored to filesystem): + + [litestore -m:admin](class:cmd) + #### Importing a directory +Import a directory called **admin**: + +[litestore import -d:admin](class:cmd) + #### Exporting a directory +Export all documents tagged with **$dir:admin** to a local directory called **admin**: + +[litestore -e:admin](class:cmd) + #### Deleting documents within a directory -#### Performing maintenance operations+Delete all documents tagged with **$dir:admin**: + +[litestore -d:admin](class:cmd) + +#### Performing maintenance operations + +* vacuum: + + [litestore vacuum](class:cmd) + +* optimize search index: + + [litestore optimize](class:cmd)
M lib/cli.nimlib/cli.nim

@@ -60,7 +60,7 @@ Usage:

LS [command] [option1 option2 ...] Commands: - run Starts LiteStore server. + run Start LiteStore server (default if no command specified). delete Delete a previously-imported specified directory (requires -d). import Import the specified directory into the datastore (requires -d). export Export the previously-imported specified directory to the current directory (requires -d).