Skip to content

Commit

Permalink
Travis CI initial try -- update to readme
Browse files Browse the repository at this point in the history
brandongoode committed Feb 26, 2014
1 parent f552864 commit 55823a2
Showing 2 changed files with 45 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- "0.10"
before_script:
- npm install -g grunt-cli
- wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest
- tar xfz dynamodb_local_latest -C dynamodb_local
- cd dynamodb_local
- java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -inMemory &
38 changes: 36 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -252,7 +252,7 @@ var odie = new Dog({
});
```

#### model.put(callback) & model.save(callback)
#### model.put(options, callback) & model.save(options, callback)

Puts the item in the DynamoDB table. Will overwrite the item.

@@ -263,9 +263,32 @@ odie.save(function (err) {
});
```

##### Options

**overwrite**: boolean

Overwrite existing item. Defaults to true.

#### Model.create(object, options, callback)

Creates a new instance of the model and save the item in the table.

```js
Dog.create({
ownerId: 4,
name: 'Odie',
breed: 'Beagle',
color: ['Tan'],
cartoon: true
}, function(err, odie) {
if(err) { return console.log(err); }
console.log('Odie is a ' + odie.breed);
});
```

#### Model.get(key, options, callback)

Get's an item from the table.
Gets an item from the table.

```js
Dog.get('{ownerId: 4, name: 'Odie'}, function(err, odie) {
@@ -274,6 +297,17 @@ Dog.get('{ownerId: 4, name: 'Odie'}, function(err, odie) {
});
```
#### Model.delete(key, options, callback)
Deletes an item from the table.
```js
Dog.delete('{ownerId: 4, name: 'Odie'}, function(err) {
if(err) { return console.log(err); }
console.log('Bye bye Odie');
});
```

#### model.delete(callback)

Deletes the item from the table.

0 comments on commit 55823a2

Please sign in to comment.