share/rest — pull request #1 by itoldya (2014-10-29 09:13:05+00:00)
Title: fetching list of documents

Interface similar to mongolab - http://docs.mongolab.com/restapi/#list-documents
- ```q=``` - restrict results by the specified JSON query
- ```c=true``` - return the result count for this query
- ```s=``` - specify the order in which to sort each specified field (1- ascending; -1 - descending)
- ```sk=``` - specify the number of results to skip in the result set; useful for paging
- ```l=``` - specify the limit for the number of results

#### Examples
```
// find all active items
GET /doc/item/?q={"active":true}

// get the number of inactive items
GET /doc/tour/?q={"active":false}&c=true

// find the 10 most expensive items
GET /doc/tour/?l=10&s={"price": -1}

// find items from 10 to 20 sorted by title
GET /doc/tour/?l=10&sk=10&s={"name": 1}
```

#### Response example
```
{
objects: [ {
data: [Object],
type: 'http://sharejs.org/types/simple',
v: 1,
docName: 'iphone5s',
m: null
}, {
data: [Object],
type: 'http://sharejs.org/types/simple',
v: 1,
docName: 'iphone6',
m: null
}, {
data: [Object],
type: 'http://sharejs.org/types/simple',
v: 1,
docName: 'iphone6plus',
m: null
} ] ,
meta: {
limit: 3,
offset: 1,
total_count: 4
},
}
```