New to Mockoon. I have a data bucket like this:
[
{
"id": 1,
"parentObjectServiceType": 14,
"parentObjectId": 4,
"title": "Note Title Public",
},
{
"id": 2,
"parentObjectServiceType": -1,
"parentObjectId": -1,
"title": "Note Title Private",
}
]
It is connected to a CRUD route (called notes) so that I can do GET, PUT, POST, and DELETE calls automatically. In addition to this, I would like to filter out the GET using query strings such as:
/notes?parentObjectServiceType=14&parentObjectId=4
This should return the first element of the array above.
I am unable to do this. Any pointers will be appreciated.
[Update 2024-01-01]
It is now possible to filter on CRUD routes using query parameters and operators.
You can achieve what you want by doing something like this:
/notes?parentObjectServiceType_eq=14&parentObjectId_eq=4This is not yet possible with CRUD routes. There is an opened issue that is on the roadmap though.
The alternative is to use a combination of templating helpers on a regular HTTP route, like you can see here:
But it's not ideal and you loose the rest of the CRUD features.