Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (52 sloc) 2.45 KB
title sidebarTitle
Operation: `in`
in

Filter your entries by checking if your custom attribute (any field inside the content field) has a value that is equal to one of the values provided.

Use-cases: in

Get all content entries that is refered to another in a 1:N relationship or if you want to get all entries with a specific value in one of it's fields.

You can combined this query with the starts_with, pagination, other filter query, and query/sorting options of Stories if needed.

Filter Query Description
filter_query[author][in]=authorId&starts_with=posts/ all Posts by one Author
filter_query[customer][in]=customerId&starts_with=orders/& all Comments by one Post
filter_query[post][in]=postId&starts_with=comments/ all Comments by one Post
filter_query[seo.title][in]=Title all entries with field seo and a nested field title and the value Title
filter_query[component][in]=post all entries of one Content Type
filter_query[component][in]=post,news all entries of Content Type "post" or "news"
filter_query[featured][in]=true  all entries where the field featured is true

;examplearea

Example Request (all Posts by one Author)

Example Response (all Posts by one Author)

{
  "stories": [
    {
      "name": "My third post",
      "id": 107350,
      "uuid": "ac0d2ed0-e323-43ca-ae59-5cd7d38683cb",
      "content": {
        "_uid": "98cccd01-f807-4494-996d-c6b0de2045a5",
        "image": "//a.storyblok.com/f/44162/1500x500/68b522b06d/1500x500.jpeg",
        "title": "My second title",
        // filtered on this author attribute
        "author": "22f4fb1b-50b3-4bf2-816e-7d589e307421",
        "content": "Lorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod...",
        "schedule": "2018-08-31 21:59",
        "component": "post",
        "categories": [
          "9aa72a2f-04ae-48df-b71f-25f53044dc97"
        ],
        "description": "Description of the third"
      },
      "slug": "my-third-post",
      "full_slug": "posts/my-third-post",
      ...
    },
    {
      ...
    }
  ]
}