dynoga
**Dynoga** is a light library for use DynamoDB with javascript objects
Last updated 6 years ago by fabien0102 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dynoga 
SYNC missed versions from official npm registry.

Dynoga

NPM

Disclaimer

Dynoga is a lightweight library to use DynamoDB with JavaScript objects.

We use CRUD naming for easy matching with Backbone.ioBind

How to use

Initialize

Dynoga = require "dynoga"

db = new Dynoga
  endpoint: config.dynamoDB.endpoint
  accessKeyId: config.dynamoDB.accessKeyId
  secretAccessKey: config.dynamoDB.secretAccessKey
  region: config.dynamoDB.region

Create an item

db.create "mytable", item, (err, model) ->
  if err then console.log err
  console.log model

Read an item

keys: Key/value object, a hash is mandatory

db.read "mytable", keys, (err, model) ->
  if err then console.log err
  console.log model

Update an item

item: Key/value object, a hash and range are mandatory

Dynoga automatically find primary keys for update the good item.

db.update "mytable", item, (err, model) ->
  if err then console.log err
  console.log model

Delete an item

item: Key/value object, a hash and range are mandatory

Dynoga automatically find primary keys for delete the good item.

db.delete "mytable", item, (err, model) ->
  if err then console.log err
  console.log model

Running Tests

Put in your environment

export METIDIA_ACCESS_KEY_ID=YOURACCESKEYID
export METIDIA_SECRET_ACCESS_KEY=YOURSECRETACCESSKEY

Run a local dynomadb instance

$ java -Djava.library.path=. -jar DynamoDBLocal.jar

cf: DynamoDB Local for Desktop Development

Run tests

npm test Execute units tests

npm run watch-test Execute units tests with watch files for changes

Warning

For a natural sorting for READ operations, Dynoga use an internal _createTimeStamp attribute. Please don't use it if you don't want surprise ;)

Current Tags

  • 0.1.4                                ...           latest (6 years ago)

19 Versions

  • 0.1.4                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.15                                ...           6 years ago
  • 0.0.14                                ...           6 years ago
  • 0.0.12                                ...           6 years ago
  • 0.0.11                                ...           6 years ago
  • 0.0.10                                ...           6 years ago
  • 0.0.9                                ...           6 years ago
  • 0.0.8                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |