0

I'm looking for a way to make filtered requests through SpringBoot Applications. Through query strings I have to create methods that allow me to return a filtered data structure. For example GET /stats?field=Popo2011&filter={"Popo2011": {"$bt": [1000, 10000]}} This is an example of a Get request with which I return only a part of the data structure. I ask how we can implement such a method / request

1 Answer 1

0
@RequestMapping(value="/stats", method=RequestMethod.GET)
public DataStructure getFilteredStats(@RequestParam(name="field) String field,
    @RequestParam(name="filter") String filter) {
    ...

You can then parse the filter String using a JSON library.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.