all repos — litestore @ 2221204d6f84d20280020d51831f2a5d2c6b3ecf

A minimalist nosql document store.

src/admin/md/nim-api_low.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
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
### Low-Level Nim API

The following [proc](class:kwd)s implement low-level operations on the LiteStore data store. Unlike the high-level API, the [proc](class:kwd)s exposed by this API do not perform the same validation checks as the corresponding HTTP operations, and they are meant to be used with caution in more advanced use cases.

{{p-ct => ct
: Determines the content type of the [body](class:kwd) parameter.}}
{{p-options => options
: A [QueryOptions](#QueryOptions) object representing a query to execute on a document.}}
{{p-folder => folder
: A logical folder where the document will be saved.}}

#### getInfo

     proc getInfo*(): LSResponse 

Retrieves information about the currently-loaded data store file.

#### getRawDocuments

     proc getRawDocuments*(options = newQueryOptions()): LSResponse 

Retrieves multiple documents in JSON format based on the specified options.

##### Parameters

{{p-options}}

#### getDocument

     proc getDocument*(id: string, options = newQueryOptions()): LSResponse 

Retrieves a single document.

##### Parameters

{{p-id}}
{{p-options}}

#### getRawDocument

     proc getRawDocument*(id: string, options = newQueryOptions()): LSResponse 

Retrieves a single document in JSON format.

##### Parameters

{{p-id}}
{{p-options}}

#### deleteDocument

     proc deleteDocument*(id: string): LSResponse 

Deletes the specified document.

##### Parameters

{{p-id}}

#### postDocument

     proc postDocument*(body, ct: string, folder=""): LSResponse 

Creates a new document in the specified folder.

##### Parameters

{{p-body}}
{{p-ct}}
{{p-folder}}

#### putDocument

     proc putDocument*(id, body, ct: string): LSResponse 

Modifies an existing document.

##### Parameters

{{p-id}}
{{p-body}}
{{p-ct}}

#### patchDocument

     proc patchDocument*(id, body: string): LSResponse 

Modifies the tags of an existing document.

##### Parameters

{{p-id}}
{{p-body}}