Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

change view for simplicity

  • Loading branch information...
commit 9b6d25f7db08e0fdd606bd426790c2bd0cf08ad5 1 parent 2dd6788
Raphaël Bleuse authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 poc_list.coffee
View
9 poc_list.coffee
@@ -25,9 +25,14 @@ initDB = (cb) ->
console.log 'DB recreated'
docs = ({'type':'dumb_doc', 'num':num} for num in [0..10])
db.save docs, ->
- cb()
+ map = (doc) ->
+ emit doc.num, doc
+ return
+ view = {map:map}
+ db.save '_design/test-design', {allByNum:view}, ->
+ cb()
initDB ->
- db.all {include_docs: true}, (err, res) ->
+ db.view 'test-design/allByNum', (err, res) ->
console.log err if err?
console.log JSON.stringify res, null, 4 if res?

0 comments on commit 9b6d25f

Please sign in to comment.
Something went wrong with that request. Please try again.