Safe Haskell | None |
---|
CouchDB View Query options.
For details see
http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options. Note,
because all options must be a proper URL encoded JSON, construction of
complex parameters can be very tedious. To simplify this, use mkQuery
.
- data CouchQP
- = forall a . ToJSON a => QPComplex ByteString a
- | QPBS ByteString ByteString
- | QPInt ByteString Int
- | QPBool ByteString Bool
- | QPDescending
- | QPLimit Int
- | QPSkip Int
- | QPStale Bool
- | forall a . ToJSON a => QPKey a
- | forall a . ToJSON a => QPStartKey a
- | forall a . ToJSON a => QPEndKey a
- | forall a . ToJSON a => QPKeys a
- | QPGroup
- | QPGroupLevel Int
- | QPReduce Bool
- | QPIncludeDocs
- | QPInclusiveEnd
- | QPUpdateSeq
- | QPStartKeyDocId Path
- | QPEndKeyDocId Path
- mkQuery :: [CouchQP] -> Query
- qpUnit :: HashMap ByteString Bool
- qpNull :: Value
Creating Query
CouchDB Query options primitives.
forall a . ToJSON a => QPComplex ByteString a | Complex view query parameter. couchQP [QPComplex "param" (["a", "b"] :: [String])] [("param", Just "[\"a\",\"b\"]")] ...?param=["a","b"] couchQP [QPComplex "key" (("a", 1) :: (String, Int))] [("key", Just "[\"a\",0]")] ...?param=["a",0] It't just convert lazy |
QPBS ByteString ByteString | Quoted ...?param="value" |
QPInt ByteString Int |
...?param=100 |
QPBool ByteString Bool |
...?param=true |
QPDescending | Reverse rows output. ...?descending=true |
QPLimit Int | Limit rows. Use ...?limit=5 |
QPSkip Int | Skip rows. Use ...?skip=10 |
QPStale Bool | Stale view. On ...?stale=ok ...?stale=update_after |
forall a . ToJSON a => QPKey a |
...?key=... |
forall a . ToJSON a => QPStartKey a | Row key to start with. Becomes ...?startkey=... ...?descending=true?endkey=... |
forall a . ToJSON a => QPEndKey a | Row key to start with. Becomes ...?endkey=... ...?descending=true?startkey=... |
forall a . ToJSON a => QPKeys a | Row key to start with. Use only with ...?keys=... |
QPGroup | Turn on grouping. ...?group=true |
QPGroupLevel Int | Set grouping level. Use ...?group_level=2 |
QPReduce Bool | Control reduce. ...?reduce=true ...?reduce=false |
QPIncludeDocs | Turn on inclusion docs in view results. ...?include_docs=true |
QPInclusiveEnd | Turn off inclusion ...?inclusive_end=false |
QPUpdateSeq | Response includes an update_seq value indicating which sequence id of the database the view reflects ...?update_seq=true |
QPStartKeyDocId Path | Document id to start with. ...?startkey_docid=... |
QPEndKeyDocId Path | Document id to end with. ...?endkey_docid=... |