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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
### 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.
#### 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
<dl>
<dt>options</dt>
<dd>A <a href="#QueryOptions">QueryOptions</a> object representing a query to execute on a document.</dd>
</dl>
#### getDocument
proc getDocument*(id: string, options = newQueryOptions()): LSResponse
Retrieves a single document.
##### Parameters
<dl>
<dt>id</dt>
<dd>The identifier of the resource (set to an empty string if not needed).</dd>
<dt>options</dt>
<dd>A <a href="#QueryOptions">QueryOptions</a> object representing a query to execute on a document.</dd>
</dl>
#### getRawDocument
proc getRawDocument*(id: string, options = newQueryOptions()): LSResponse
Retrieves a single document in JSON format.
##### Parameters
<dl>
<dt>id</dt>
<dd>The identifier of the resource (set to an empty string if not needed).</dd>
<dt>options</dt>
<dd>A <a href="#QueryOptions">QueryOptions</a> object representing a query to execute on a document.</dd>
</dl>
#### deleteDocument
proc deleteDocument*(id: string): LSResponse
Deletes the specified document.
##### Parameters
<dl>
<dt>id</dt>
<dd>The identifier of the resource (set to an empty string if not needed).</dd>
</dl>
#### postDocument
proc postDocument*(body, ct: string, folder=""): LSResponse
Creates a new document in the specified folder.
##### Parameters
<dl>
<dt>body</dt>
<dd>The request body.</dd>
<dt>ct</dt>
<dd>Determines the content type of the <span class="kwd">body</span> parameter.</dd>
<dt>folder</dt>
<dd>A logical folder where the document will be saved.</dd>
</dl>
#### putDocument
proc putDocument*(id, body, ct: string): LSResponse
Modifies an existing document.
##### Parameters
<dl>
<dt>id</dt>
<dd>The identifier of the resource (set to an empty string if not needed).</dd>
<dt>body</dt>
<dd>The request body.</dd>
<dt>ct</dt>
<dd>Determines the content type of the <span class="kwd">body</span> parameter.</dd>
</dl>
#### patchDocument
proc patchDocument*(id, body: string): LSResponse
Modifies the tags of an existing document (or the body of a JSON document).
##### Parameters
<dl>
<dt>id</dt>
<dd>The identifier of the resource (set to an empty string if not needed).</dd>
<dt>body</dt>
<dd>The request body.</dd>
</dl>
|