# 백본 컬렉션 URL에 쿼리 붙이기

## 컬렉

```javascript
export let Users = Backbone.Collection.extend({
  url: "/api/users/",
  model: User,
  parse: function (response) {
    return response.users;
  }
});

let users = new Users();

users.fetch() // get /api/users/
```

### 쿼리 하나만 날리기

```javascript
 // /api/users?status=online
users.fetch({ data: $param({ status: "online"}) });
```

### 쿼리 여러개 날리기

```javascript
let params = {
  "status": "online",
  "gender": "man"
};
// /api/users?status=online&gender=man
users.fetch( {data: $.param(params)} );
```

### 쿼리에 배열 보내기

```javascript
// /api/users?status[]=online&status[]=playing
users.fetch({data: $param({ status: ["online", "playing"]}) })
```

### 아래 두 페이지와 연관되서 유용하게 사용된다.

{% content-ref url="/pages/-MSYJNS7xi2iyZh8mDY0" %}
[StrongParameter 쿼리 배열 받기](/blog/undefined/rubyonrails/undefined-3/strongparameter.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MSYLE0vTul-auxsv\_rw" %}
[레일즈 where 사용법](/blog/undefined/rubyonrails/undefined-7/where.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://simian114.gitbook.io/blog/undefined/backbonejs/url.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
