node-dynamodb 
A (work-in-progress) Mongoose-like API for DynamoDB
DynamoDB
Example:
var DynamoDB = require('node-dynamodb');
Methods
DynamoDB.model(schema, options)
Define your model.
Example:
var Movie = DynamoDB.model('Movies', new DynamoDB.Schema({
year: {
type: DynamoDB.types.Number,
index: DynamoDB.types.Hash
},
title: {
type: DynamoDB.types.String,
index: DynamoDB.types.Range
}
}, {
readCapacity: 10,
writeCapacity: 20
}));
DynamoDB.connect(options, callback);
Connect, and sync your defined models.
env
- The environmentdatabase
- The environmentconnection
- Object with an instance of new AWS.DynamoDB
for db
and new AWS.DynamoDB.DocumentClient
for client
logger
- Optional interface that implements info
, warn
, error
, fatal
, debug
, trace
and child
.
Example:
DynamoDB.connect({
env: 'dev',
database: 'biem',
connection: {
db: new AWS.DynamoDB({
endpoint: new AWS.Endpoint('http://localhost:4337')
}),
client: new AWS.DynamoDB.DocumentClient({
endpoint: new AWS.Endpoint('http://localhost:4337')
})
}
}, function(err, data) {
console.log(data);
});
Movie.put(details, callback);
Put an item.
Example:
Movie.put({
year: 2001,
title: 'A Beautiful Mind'
}, done);
Movie.get(details, callback);
GET an item.
Example:
Movie.get({
year: 2001,
title: 'A Beautiful Mind'
}, done);
Author
Credits
Shout out to Nathan Peck for sharing his exploration project