Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
polydb:rest:intro [2020/03/31 08:58] – created paffenholz | polydb:rest:intro [2023/03/24 21:52] – [polyDB REST API] paffenholz | ||
---|---|---|---|
Line 5: | Line 5: | ||
Base path: | Base path: | ||
< | < | ||
- | https:// | + | https:// |
</ | </ | ||
+ | |||
+ | The API implements the following endpoints: | ||
+ | * Info on collections | ||
+ | * section | ||
+ | * sections | ||
+ | * collection | ||
+ | * collections | ||
+ | * Schema | ||
+ | * schema | ||
+ | * Querying the Database | ||
+ | * find | ||
+ | * find_one | ||
+ | * count | ||
+ | * distinct | ||
+ | * id | ||
+ | |||
+ | Some examples are below. For a full documentation of all endpoints with examples for data and code see [[https:// | ||
==== Obtain info on available collections ==== | ==== Obtain info on available collections ==== | ||
- | === Section | + | === section |
- | Section Documentation | + | This returns section documentation |
< | < | ||
- | / | + | https:// |
</ | </ | ||
with possible parameters < | with possible parameters < | ||
< | < | ||
- | / | + | https:// |
</ | </ | ||
returns | returns | ||
Line 46: | Line 63: | ||
=== sections === | === sections === | ||
+ | |||
+ | This returns a list of subsections of the given one | ||
=== collection === | === collection === | ||
+ | This prints full information on a collection. The collection is given as | ||
< | < | ||
- | / | + | / |
+ | </ | ||
+ | |||
+ | Here is an example: | ||
+ | < | ||
+ | https:// | ||
</ | </ | ||
=== collections === | === collections === | ||
+ | This lists all collections contained in a section. | ||
< | < | ||
- | / | + | / |
+ | </ | ||
+ | |||
+ | Example: | ||
+ | < | ||
+ | https:// | ||
+ | </ | ||
+ | returns | ||
+ | < | ||
+ | [ | ||
+ | |||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | ] | ||
</ | </ | ||
Line 63: | Line 105: | ||
=== find === | === find === | ||
- | Example | + | This endpoint does a general query on the given collection and returns a list of the results. You can set the options sort, limit, and skip. However, the query never returns more than 10 entries. |
+ | |||
+ | Example: | ||
< | < | ||
- | / | + | https:// |
</ | </ | ||
+ | will return at most 10 reflexive polytopes with 5 vertices, skipping the first 100 matches. | ||
=== find_one === | === find_one === | ||
- | Example | + | This works as find, but returns at most one match. The option limit does not apply here. |
+ | |||
+ | Example: | ||
< | < | ||
- | / | + | https:// |
</ | </ | ||
+ | |||
=== distinct === | === distinct === | ||
=== count === | === count === | ||
+ | |||
+ | This counts the number of results that match a given query. Example: | ||
+ | < | ||
+ | https:// | ||
+ | </ | ||
+ | returns | ||
+ | < | ||
+ | 139983 | ||
+ | </ | ||
+ | |||
+ | === id === | ||
+ | |||
+ | Returns a single document by its id. | ||
+ | |||
+ | Example | ||
+ | < | ||
+ | https:// | ||
+ | </ | ||
+ | |||
==== Obtain the JSON Schema for the data ==== | ==== Obtain the JSON Schema for the data ==== | ||
Line 86: | Line 152: | ||
Example | Example | ||
< | < | ||
- | / | + | https:// |
</ | </ | ||