@@ -347,7 +347,7 @@ const dblist = await nano.db.list()
347347Lists all the CouchDB databases as a stream:
348348
349349``` js
350- nano .db .listAsStream ()
350+ ( await nano .db .listAsStream () )
351351 .on (' error' , (e ) => console .error (' error' , e))
352352 .pipe (process .stdout )
353353```
@@ -418,7 +418,7 @@ const c = await nano.db.changes('alice')
418418Same as ` nano.db.changes ` but returns a stream.
419419
420420``` js
421- nano .db .changes (' alice' ).pipe (process .stdout )
421+ ( await nano .db .changes (' alice' ) ).pipe (process .stdout )
422422```
423423
424424### nano.db.info()
@@ -602,7 +602,7 @@ const doclist = await alice.list({include_docs: true})
602602List all the docs in the database as a stream.
603603
604604``` js
605- alice .listAsStream ()
605+ ( await alice .listAsStream () )
606606 .on (' error' , (e ) => console .error (' error' , e))
607607 .pipe (process .stdout )
608608```
@@ -858,12 +858,12 @@ Fetch documents from a partition as a stream:
858858
859859``` js
860860// fetch document id/revs from a partition
861- nano .db .partitionedListAsStream (' canidae' )
861+ ( await nano .db .partitionedListAsStream (' canidae' ) )
862862 .on (' error' , (e ) => console .error (' error' , e))
863863 .pipe (process .stdout )
864864
865865// add document bodies but limit size of response
866- nano .db .partitionedListAsStream (' canidae' , { include_docs: true , limit: 5 })
866+ ( await nano .db .partitionedListAsStream (' canidae' , { include_docs: true , limit: 5 }) )
867867 .on (' error' , (e ) => console .error (' error' , e))
868868 .pipe (process .stdout )
869869```
@@ -883,7 +883,7 @@ Query documents from a partition by supplying a Mango selector as a stream:
883883
884884``` js
885885// find document whose name is 'wolf' in the 'canidae' partition
886- db .partitionedFindAsStream (' canidae' , { ' selector' : { ' name' : ' Wolf' }})
886+ ( await db .partitionedFindAsStream (' canidae' , { ' selector' : { ' name' : ' Wolf' }}) )
887887 .on (' error' , (e ) => console .error (' error' , e))
888888 .pipe (process .stdout )
889889```
@@ -908,7 +908,7 @@ Search documents from a partition by supplying a Lucene query as a stream:
908908const params = {
909909 q: ' name:\' Wolf\' '
910910}
911- db .partitionedSearchAsStream (' canidae' , ' search-ddoc' , ' search-index' , params)
911+ ( await db .partitionedSearchAsStream (' canidae' , ' search-ddoc' , ' search-index' , params) )
912912 .on (' error' , (e ) => console .error (' error' , e))
913913 .pipe (process .stdout )
914914// { total_rows: ... , bookmark: ..., rows: [ ...] }
@@ -938,7 +938,7 @@ const params = {
938938 endkey: ' b' ,
939939 limit: 1
940940}
941- db .partitionedViewAsStream (' canidae' , ' view-ddoc' , ' view-name' , params)
941+ ( await db .partitionedViewAsStream (' canidae' , ' view-ddoc' , ' view-name' , params) )
942942 .on (' error' , (e ) => console .error (' error' , e))
943943 .pipe (process .stdout )
944944// { rows: [ { key: ... , value: [Object] } ] }
@@ -994,7 +994,7 @@ fs.readFile('rabbit.png', (err, data) => {
994994### db.attachment.insertAsStream(docname, attname, att, contenttype, [ params] )
995995
996996As of Nano 9.x, the function ` db.attachment.insertAsStream ` is now deprecated. Now simply pass
997- a readable stream to ` db.attachment.insert ` as the third paramseter .
997+ a readable stream to ` db.attachment.insert ` as the third parameter .
998998
999999### db.attachment.get(docname, attname, [ params] )
10001000
@@ -1012,7 +1012,7 @@ fs.writeFile('rabbit.png', body)
10121012
10131013``` js
10141014import fs from ' node:fs'
1015- alice .attachment .getAsStream (' rabbit' , ' rabbit.png' )
1015+ ( await alice .attachment .getAsStream (' rabbit' , ' rabbit.png' ) )
10161016 .on (' error' , e => console .error )
10171017 .pipe (fs .createWriteStream (' rabbit.png' ))
10181018```
@@ -1062,7 +1062,7 @@ const body = alice.view('characters', 'happy_ones', { include_docs: true })
10621062Same as ` db.view ` but returns a stream:
10631063
10641064``` js
1065- alice .viewAsStream (' characters' , ' happy_ones' , {reduce: false })
1065+ ( await alice .viewAsStream (' characters' , ' happy_ones' , {reduce: false }) )
10661066 .on (' error' , (e ) => console .error (' error' , e))
10671067 .pipe (process .stdout )
10681068```
@@ -1080,7 +1080,7 @@ const body = await alice.viewWithList('characters', 'happy_ones', 'my_list')
10801080Calls a list function fed by the given view from the specified design document as a stream.
10811081
10821082``` js
1083- alice .viewWithListAsStream (' characters' , ' happy_ones' , ' my_list' )
1083+ ( await alice .viewWithListAsStream (' characters' , ' happy_ones' , ' my_list' ) )
10841084 .on (' error' , (e ) => console .error (' error' , e))
10851085 .pipe (process .stdout )
10861086```
@@ -1143,7 +1143,7 @@ Check out the tests for a fully functioning example.
11431143Calls a view of the specified design with optional query string additions ` params ` . Returns stream.
11441144
11451145``` js
1146- alice .search (' characters' , ' happy_ones' , { q: ' cat' }).pipe (process .stdout )
1146+ ( await alice .search (' characters' , ' happy_ones' , { q: ' cat' }) ).pipe (process .stdout )
11471147```
11481148
11491149### db.find(selector)
@@ -1177,7 +1177,7 @@ const q = {
11771177 fields: [ " name" , " age" , " tags" , " url" ],
11781178 limit: 50
11791179}
1180- alice .findAsStream (q)
1180+ ( await alice .findAsStream (q) )
11811181 .on (' error' , (e ) => console .error (' error' , e))
11821182 .pipe (process .stdout )
11831183```
@@ -1260,7 +1260,7 @@ import fs from 'node:fs'
12601260import Nano from ' nano'
12611261const nano = Nano (' http://127.0.0.1:5984/' )
12621262const alice = nano .use (' alice' )
1263- alice .attachment .getAsStream (' rabbit' , ' picture.png' )
1263+ ( await alice .attachment .getAsStream (' rabbit' , ' picture.png' ) )
12641264 .on (' error' , (e ) => console .error (' error' , e))
12651265 .pipe (fs .createWriteStream (' /tmp/rabbit.png' ))
12661266```
0 commit comments