/datastore/pipeline
Body:
collection
- Type: String
- Examples:
"logs"
,"anomalies"
index
- Type: JSON
- Examples:
{ documentID: "docgasu7268asd97ds9ijdaoslk" }
pipeline
- Type: List
- Examples:
[ { type: "match", filter: { temperature: 25 } }, { type: "project", specs: { time: 1, temperature: 1 } } ]
nPage
- Type: Integer
- Examples:
1
,10
Success response:
code
"DATASTORE-DOCUMENTS-FETCHED"
message
"Documents are fetched as a result of successful execution of the query."
nDocuments
- Type: Integer
- Examples:
1
documents
- Type: List
- Examples:
[ { documentID: "ck12676391dgjhwag918790128", time: 1683885667842, temperature: 25 } ]
Error response:
DATA-INVALID
{ code: "DATA-INVALID", message: "Collection name is required to be specified." }
DATASTORE-DOCUMENTS-FETCH-FAILED
{ code: "DATASTORE-DOCUMENTS-FETCH-FAILED", message: "An unknown error occurred while searching into the datastore." }
Usage:
curl "https://api.grandeur.tech/datastore/pipeline?apiKey=${API_KEY}" -H "Authorization: ${AUTH_TOKEN}" --json '{"collection": "anomalies", "index": {}, "pipeline": [{"type": "match", "filter": {"temperature": 25}}, {"type": "project", "specs": {"time": 1, "temperature": 1}}], "nPage": 1}'
Output
JSON
{
"code": "DATASTORE-DOCUMENTS-FETCHED",
"message": "Documents are fetched as a result of successful execution of the query.",
"nDocuments": 1,
"documents": [ {
documentID: "ck12676391dgjhwag918790128",
time: 1683885667842,
temperature: 25
} ]
}