I am trying to count the posts made by userid 4 

this is what i have so far 

```
    curl -s 'http://jsonplaceholder.typicode.com/posts' |  jq '.[] |select(.userId==4) | length'

```

output : 

```
   4

   4

   4

   4

   4

   4

   4

   4

   4

   4

```

data can be found at the url but here is a quick sample 

```
    [
      {
        "userId": 1,
        "id": 1,
        "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
        "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
      },
      {
        "userId": 1,
        "id": 2,
        "title": "qui est esse",
        "body": "est rerum tempore vitae\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\nqui aperiam non debitis possimus qui neque nisi nulla"
      },
      {
        "userId": 1,
        "id": 3,
        "title": "ea molestias quasi exercitationem repellat qui ipsa sit aut",
        "body": "et iusto sed quo iure\nvoluptatem occaecati omnis eligendi aut ad\nvoluptatem doloribus vel accusantium quis pariatur\nmolestiae porro eius odio et labore et velit aut"
      }]

```

I know there are 10 post by the userId 4 so its picking them up i think there is a problem with the length part ? 

it should just count the posts by userId and display the answer which is 10

EDIT :: If you think the question is acceptable please could you up-vote so i can gain reputation etc