Dear DATAGERRY community,
As we can see from the API documentation, you need to address the so-called public_id.
Is there a way to get the corresponding public_id for a “name” via the API?
Or is there perhaps a way to trigger a search via the API? Unfortunately we could not find anything in the API documentation.
All the best,
Stephan
Hello @Lostboi ,
in the attachment you will find a small example of searching for a type by name.
GET /rest/types/?
sort='public_id'&
order=1&
page=1&
limit=10&
filter=[
{"$addFields":
{"public_id":
{"$toString":"$public_id"}
}
},
{"$match":
{"$or":[
{"public_id":
{"$regex":"Example","$options":"ismx"}
},
{"name":
{"$regex":"Example","$options":"ismx"}
},
{"author_id":
{"$regex":"Example","$options":"ismx"}
},
{"editor_id":
{"$regex":"Example","$options":"ismx"}
},
{"public_id":
{"$elemMatch":
{"value":
{"$regex":"Example","$options":"ismx"}
}
}
}
]}
}
] HTTP/1.1
Host: localhost:4000
Content-Type: application/json
Authorization: Basic YWRtaW46YWRtaW4=
cache-control: no-cache
Postman-Token: 7fdc7e4f-176d-4fbd-a2c8-c0aa2c367a6b
The structure of our filter function via Rest is based on the structure of the Aggregatino pipelines (Operator)of the MongoDB library. With the Aggregatino pipelines you can map all search queries. No data is created or changed with the Aggregatino pipelines. They are only used for display.
With kind regards