Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3637

Strapi API Rest V 3.6.8 how to search posts by title?

$
0
0

I have installed version 3.6.8 of Strapi

In the docs for v3.xhttps://strapi.gitee.io/documentation/v3.x/content-api/parameters.html#filter

Filters are used as a suffix of a field name:

  • No suffix or eq: Equals
  • ne: Not equals
  • lt: Less than
  • gt: Greater than
  • lte: Less than or equal to
  • gte: Greater than or equal to
  • in: Included in an array of values
  • nin: Isn't included in an array of values
  • contains: Contains
  • ncontains: Doesn't contain
  • containss: Contains case sensitive
  • ncontainss: Doesn't contain case sensitive
  • null: Is null/Is not null

And I can see those examples

GET /restaurants?_where[price_gte]=3

GET /restaurants?id_in=3&id_in=6&id_in=8

etc..

So I tried

/posts?_where[title_contains]=foo/posts?title_contains=foo

And I also tried the "new way" in V4

/posts?filters[title][contains]=foo

But all of this attempts return all the post, exactly the same than just doing

/posts?

Any idea how to filter by post title and/or post body?


Viewing all articles
Browse latest Browse all 3637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>