all repos — litestore @ cd4b3f1a419f9900d51beaaf666ab338e3dfe98f

A minimalist nosql document store.

admin/md/usage.md

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
## Usage

### Command Line Syntax

[litestore](class:kwd) **[** _command_ **]** **[** _option1_, _option2_, ... **]**

#### Commands

* **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).
* **optimize** — Optimize search indexes.
* **vacuum** — Vacuum datastore.

#### Options

* **-a**, **-\-address** — Specify server address (default: 127.0.0.1).
* **-d**, **-\-directory** — Specify a directory to serve, import, export, delete, or mount.
* **-h**, **-\-help** — Display program usage.
* **-l**, **-\-log** — Specify the log level: debug, info, warn, error, none (default: info)
* **-m**, **-\-mount** — Mirror database changes to the specified directory on the filesystem.
* **-p**, **-\-port** —Specify server port number (default: 9500).
* **-r**, **-\-readonly** — Allow only data retrieval operations.
* **-s**, **-\-store** — Specify a datastore file (default: data.db)
* **-v**, **-\-version** — 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)
  
* serving the contents of a directory called **admin**:

  [litestore -d:admin](class:cmd)

* mouting a directory called **admin** (changes will be mirrored to filesystem, directory contents will be served):

  [litestore -d:admin -m](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 export -d:admin](class:cmd)

#### Deleting documents within a directory

Delete all documents tagged with **$dir:admin**:

[litestore delete -d:admin](class:cmd)

#### Performing maintenance operations

* vacuum SQlite database:

  [litestore vacuum](class:cmd)

* optimize search index:

  [litestore optimize](class:cmd)