Skip to content

Update a few spots in readme and fix a require statement #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@ This package has made changes in pouchdb-adapter-websql and pouch-adapter-http f
npm install --save react-native-sqlite-2
npm install --save https://github.com/kkbhav/pouchdb-adapters-rn.git
npm install --save https://github.com/kkbhav/react-native-fetch-blob.git
react-native link rn-fetch-blob
react-native link react-native-fetch-blob
react-native link react-native-sqlite-2

```
#### - Extra step for Android

```java
// Ensure you have these dependencies in /android/app/build.gradle:
dependencies {
compile project(':react-native-sqlite-2')
compile project(':react-native-fetch-blob')
...
}
```
#### - Extra step for iOS

Expand Down Expand Up @@ -47,11 +58,11 @@ var remote = new PouchDB('http://127.0.0.1:5984/mydb');

4. **remote.putAttachment(docId, attachmentId, [rev], attachment, type, [callback])**
- attachment: file-uri or base64(cannot process blob types)

5. **remote.put(doc)** or **remote.bulkDocs(docs)**
- accepts file-uri or base64 in attachment data,
- accepts file-uri or base64 in attachment data,
Example doc

```js
const doc = {
_id: 'somethings',
Expand All @@ -76,17 +87,17 @@ var remote = new PouchDB('http://127.0.0.1:5984/mydb');
3. **db.allDocs(options)**
- extra options values(optional)
- path: boolean to return attachment as fileUri(optional, if not passed base64 string will be returned)

4. **db.get(docId)**
- will return attachment as base64 if requested

5. **db.putAttachment(docId, attachmentId, [rev], attachment, type, [callback])**
- attachment: file-uri or base64(cannot process blob types)

6. **db.bulkDocs(docs)**
- accepts path in attachment data,
Example docs

```js
const docs = [{
_id: 'somethings',
Expand All @@ -99,11 +110,11 @@ var remote = new PouchDB('http://127.0.0.1:5984/mydb');
}]
db.bulkDocs(docs);
```

7. **db.put(doc)**
- accepts path in attachment data,
Example docs

```js
const doc = {
_id: 'somethings',
Expand Down
2 changes: 1 addition & 1 deletion lib/RNPouchUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var pouchdbMerge = require('pouchdb-merge');
var pouchdbBinaryUtils = require('pouchdb-binary-utils');
var pouchdbMd5 = require('pouchdb-md5');
var pouchdbCollections = require('pouchdb-collections');
var RNFetchBlob = require('rn-fetch-blob').default;
var RNFetchBlob = require('react-native-fetch-blob').default;
var Platform = require('react-native').Platform;

function allDocsKeysQuery(api, opts) {
Expand Down