> For the complete documentation index, see [llms.txt](https://docs.medable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.medable.com/cortex-api/scripting/cortexobject/views.md).

# Views

### &#x20; Import

```javascript
const Views = org.objects.views;
// import Views from 'views';
// const Views = CortexObject.as('views');
```

### Methods

run(name, options)\
passthru(name, options)

### run(name, options)

Run a stored View.

**Arguments**

* `name` (String) the view name
* `options`
  * `where`
  * `map`
  * `group`
  * `sort`
  * `paths`
  * `limit`
  * `skip`
  * `pipeline`

**Returns**

Object\[]

### passthru(name, options)

Runs a stored View and returns a cursor (without fetching any results) which can be returned from a route script and streamed directly through the api. See QueryCursor.passthru()

**Arguments**

* `name` (String) the view name
* `options`
  * `where`
  * `map`
  * `group`
  * `sort`
  * `paths`
  * `limit`
  * `skip`
  * `pipeline`

**Returns**

Cursor
