You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -122,7 +122,7 @@ and to use an existing database:
122
122
constalice=nano.db.use('alice');
123
123
```
124
124
125
-
Under-the-hood, calls like `nano.db.create` are making HTTP API calls to the CouchDB service. Such operations are *asynchronous*. There are two ways to recieve the asynchronous data back from the library
125
+
Under-the-hood, calls like `nano.db.create` are making HTTP API calls to the CouchDB service. Such operations are *asynchronous*. There are two ways to receive the asynchronous data back from the library
126
126
127
127
1) Promises
128
128
@@ -213,9 +213,9 @@ You can also pass options to the require to specify further configuration option
213
213
// nano parses the URL and knows this is a database
214
214
constopts= {
215
215
url:'http://localhost:5984/foo',
216
-
requestDefaults: {
217
-
proxy: {
218
-
protocol:'http',
216
+
requestDefaults: {
217
+
proxy: {
218
+
protocol:'http',
219
219
host:'myproxy.net'
220
220
},
221
221
headers: {
@@ -268,10 +268,10 @@ const myagent = new http.Agent({
268
268
maxSockets:25
269
269
})
270
270
271
-
constdb=require('nano')({
271
+
constdb=require('nano')({
272
272
url:'http://localhost:5984/foo',
273
-
requestDefaults : {
274
-
agent : myagent
273
+
requestDefaults : {
274
+
agent : myagent
275
275
}
276
276
});
277
277
```
@@ -374,7 +374,7 @@ has to exist, add `create_target:true` to `opts` to create it prior to
374
374
replication:
375
375
376
376
```js
377
-
constresponse=awaitnano.db.replicate('alice',
377
+
constresponse=awaitnano.db.replicate('alice',
378
378
'http://admin:password@otherhost.com:5984/alice',
379
379
{ create_target:true })
380
380
```
@@ -386,7 +386,7 @@ with options `opts`. `target` has to exist, add `create_target:true` to
386
386
`opts` to create it prior to replication. Replication will survive server restarts.
@@ -397,7 +397,7 @@ Queries the state of replication using the new CouchDB API. The `id` comes from
397
397
given by the call to `replication.enable`:
398
398
399
399
```js
400
-
constr=awaitnano.db.replication.enable('alice',
400
+
constr=awaitnano.db.replication.enable('alice',
401
401
'http://admin:password@otherhost.com:5984/alice',
402
402
{ create_target:true })
403
403
constq=awaitnano.db.replication.query(r.id)
@@ -409,7 +409,7 @@ Disables replication using the new CouchDB API. The `id` comes from the response
409
409
by the call to `replication.enable`:
410
410
411
411
```js
412
-
constr=awaitnano.db.replication.enable('alice',
412
+
constr=awaitnano.db.replication.enable('alice',
413
413
'http://admin:password@otherhost.com:5984/alice',
414
414
{ create_target:true })
415
415
awaitnano.db.replication.disable(r.id);
@@ -671,7 +671,7 @@ If you want `changesReader` to hold off making the next `_changes` API call unti
671
671
db.changesReader.get({wait:true})
672
672
.on('batch', (b) => {
673
673
console.log('a batch of', b.length, 'changes has arrived');
674
-
// do some asynchronous work here and call "changesReader.resume()"
674
+
// do some asynchronous work here and call "changesReader.resume()"
675
675
// when you're ready for the next API call to be dispatched.
676
676
// In this case, wait 5s before the next changes feed request.
677
677
setTimeout( () => {
@@ -692,7 +692,7 @@ You may supply a number of options when you start to listen to the changes feed:
692
692
| wait | For `get`/`start` mode, automatically pause the changes reader after each request. When the the user calls `resume()`, the changes reader will resume. | false | e.g. true |
693
693
| fastChanges | Adds a seq_interval parameter to fetch changes more quickly | false | true | |
694
694
| selector | Filters the changes feed with the supplied Mango selector | {"name":"fred} | null | |
695
-
| timeout | The number of milliseconds a changes feed request waits for data| 60000 | 10000
695
+
| timeout | The number of milliseconds a changes feed request waits for data| 60000 | 10000 |
696
696
697
697
The events it emits are as follows:s
698
698
@@ -734,7 +734,7 @@ The `batch` event delivers an array of change objects.
734
734
735
735
## Partition Functions
736
736
737
-
Functions related to [partitioned databses](https://docs.couchdb.org/en/latest/partitioned-dbs/index.html).
737
+
Functions related to [partitioned databases](https://docs.couchdb.org/en/latest/partitioned-dbs/index.html).
738
738
739
739
Create a partitioned database by passing `{ partitioned:true }` to `db.create`:
740
740
@@ -771,7 +771,7 @@ const i = {
771
771
partitioned:true,
772
772
type:'json'
773
773
}
774
-
774
+
775
775
// instruct CouchDB to create the index
776
776
awaitdb.index(i)
777
777
```
@@ -784,7 +784,7 @@ const func = function(doc) {
784
784
index('name', doc.name)
785
785
index('latin', doc.latin)
786
786
}
787
-
787
+
788
788
// the design document containing the search definition function
789
789
constddoc= {
790
790
_id:'_design/search-ddoc',
@@ -807,7 +807,7 @@ MapReduce views can be created by writing a design document with `opts.partition
0 commit comments