Skip to content

Commit

Permalink
feat: make it work with PouchDB
Browse files Browse the repository at this point in the history
BREAKING CHANGE: We changed the API so that it can be used with PouchDB.
  • Loading branch information
KlausTrainer committed Sep 24, 2016
1 parent 1c7dd25 commit 59d9e97
Show file tree
Hide file tree
Showing 4 changed files with 287 additions and 254 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const dynamoDBOptions = {
}

const options = {
db: location => new DynamoDBDOWN(location),
db: DynamoDBDOWN,
dynamodb: dynamoDBOptions // required AWS configuration
}

Expand Down Expand Up @@ -69,7 +69,7 @@ const dynamoDBOptions = {
}

const options = {
db: location => new DynamoDBDOWN(location),
db: location => DynamoDBDOWN,
dynamodb: dynamoDBOptions // required AWS configuration
}

Expand All @@ -80,7 +80,7 @@ const db = levelup('tableName', options)

In DynamoDB, keys consist of two parts: a *hash key* and a *range key*. To achieve LevelDB-like behaviour, all keys in a database instance are given the same hash key. That means that you can't do range queries over keys with different hash keys.

The default hash key is `!`. You can specify it by putting a `/` in the `location` argument. The `/` separates the table name from the hash key.
The default hash key is `!`. You can specify it by putting a `$` in the `location` argument. The `$` separates the table name from the hash key.

### Example ###

Expand All @@ -95,7 +95,7 @@ const dynamoDBOptions = {
}

const options = {
db: location => new DynamoDBDOWN(location),
db: DynamoDBDOWN,
dynamodb: dynamoDBOptions // required AWS configuration
}

Expand Down
Loading

0 comments on commit 59d9e97

Please sign in to comment.