Commits

Anonymous committed e8afa5c

Some docs

  • Participants
  • Parent commits aec265f

Comments (0)

Files changed (1)

src/Database/CouchDB/Enumerator.hs

 >    -- Read the view using couchView and print it out.
 >    run_ $ couchView "testdesign/_view/myview" [] $$
 >            EL.foldM (\_ o -> liftIO $ BL.putStrLn $ encode $ Object o) ()
+>
+>    -- .. with restrictions and extracting view value
 >    run_ $ couchView "testdesign/_view/myview" 
->            [(fromString "key", Just $ fromString "10")] $$
+>            [(fromString "key", Just $ fromString "10")] $= extractViewValue $$
 >            EL.foldM (\_ o -> liftIO $ BL.putStrLn $ encode $ Object o) ()
 >
+>    -- .. and in strict manner
+>    v1 <- couchView "testdesign/_view/myview" [] $= extractViewValue
+>            EL.consume
+>    print v1
+>
 >    -- Delete the objects
 >    couchDelete "doc1" rev3
 >    couchDelete "doc2" rev2