1.9.5 • Published 6 years ago

dynamojo v1.9.5

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

dynamojo

A super simple and lightweight DynamoDB client for nodejs.

If you are unfamiliar with DynamoDB, checkout Amazon Web Services: https://aws.amazon.com/dynamodb/

Installation

npm install --save dynamojo

Dependencies

We use dynamojo on AWS Lambda, which comes preloaded with the aws-sdk package. So this package is not listed in the dependencies of this project. You may first have to install this package. (i.e. npm install --save aws-sdk)

Credentials

We recommend you use a ~/.aws/credentials file to configure access to your DynamoDB instance. However, for convenience, there is a config method available to pass an aws config object to:

dynamojo.config({ "accessKeyId": "akid", "secretAccessKey": "secret", "region": "us-west-2" })

Documentation

Read the Full Documentation

Basic Usage

var dynamojo = require('dynamojo');

var item = {title:'hello world'};
//insert a new item, will generate a new uuid on the primary key (id)
dynamojo.insert('collection1', db_item, function(err, inserted_item){
  if(err){ console.log(err); return; }

  console.log("Inserted: %s", inserted_item.id);

  //get the item by primary key
  dynamojo.get('collection1', {id:inserted_item.id}, function(err, response){
    if(err){ console.log(err); return; }

    console.log("Found item: %s", response);

    dynamojo.update('collection1', inserted_item.id, {updated:true}, function(err, response){
      if(err){ console.log(err); return; }

      console.log("Updated item: %s", response);

    }); //end update

  }); //end get


}); //end insert
1.9.5

6 years ago

1.9.4

6 years ago

1.9.3

6 years ago

1.9.2

6 years ago

1.9.1

6 years ago

1.9.0

6 years ago

1.8.4

6 years ago

1.8.3

6 years ago

1.8.2

6 years ago

1.8.1

6 years ago

1.8.0

6 years ago

1.7.3

7 years ago

1.7.2

7 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.5.3

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.6

7 years ago

1.3.5

7 years ago

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.8

7 years ago

1.2.7

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago