Skip to content

Instantly share code, notes, and snippets.

@svngoku
Forked from bmorrisondev/sampleDynamooseModel.js
Created April 24, 2020 22:49
Show Gist options
  • Select an option

  • Save svngoku/78f5914d4d64c02823c2c1db638d5c21 to your computer and use it in GitHub Desktop.

Select an option

Save svngoku/78f5914d4d64c02823c2c1db638d5c21 to your computer and use it in GitHub Desktop.
A sample user model using Dynamoose, an ORM for AWS DynamoDB with a similar API to Mongoose
const dynamoose = require('dynamoose');
let configUpdates = {
region: "us-east-1",
accessKeyId: 'key123',
secretAccessKey: 'secret123'
}
dynamoose.AWS.config.update(configUpdates);
let tableName = 'Project.TestEnv.ModelName'
let User = dynamoose.define(tableName, {
firstName: String,
lastName: String,
emailAddress: String
})
module.exports = User;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment