@aciesai/dynamoose 中文文档教程

发布于 3年前 浏览 22 项目主页 更新于 3年前

Dynamoose

Slack Chat构建状态Coverage Status

Dynamoose 是亚马逊 DynamoDB 的建模工具(灵感来自 Mongoose)

Getting Started

Installation

$ npm i dynamoose

Example

在环境变量中设置 AWS 配置:

export AWS_ACCESS_KEY_ID="Your AWS Access Key ID"
export AWS_SECRET_ACCESS_KEY="Your AWS Secret Access Key"
export AWS_REGION="us-east-1"

这是一个简单的例子:

const dynamoose = require('dynamoose');

// Create cat model with default options
const Cat = dynamoose.model('Cat', {
  id: Number,
  name: String
});

// Create a new cat object
const garfield = new Cat({
  id: 666,
  name: 'Garfield'
});

// Save to DynamoDB
garfield.save(); // Returns a promise that resolves when save has completed

// Lookup in DynamoDB
Cat.get(666).then((badCat) => {
  console.log(`Never trust a smiling cat. - ${badCat.name}`);
});

API Docs

文档可以在 https://dynamoosejs.com/api/about/ 找到。 您还可以在 https://dynamoosejs.com/examples/about/ 找到其他示例。

Changelog

Dynamoose Changelog 可以在 CHANGELOG.md 文件中找到。

Roadmap

Dynamoose 路线图可以在 ROADMAP.md 文件中找到。 在这些项目上总是很感激帮助。 如果您能够帮助提交 PR,那么我们可以审查和改进 Dynamoose!

Contributing

要继续这个项目,请查看我们的 CONTRIBUTING.md 文件。

Dynamoose

Slack ChatBuild StatusCoverage Status

Dynamoose is a modeling tool for Amazon's DynamoDB (inspired by Mongoose)

Getting Started

Installation

$ npm i dynamoose

Example

Set AWS configurations in environment variables:

export AWS_ACCESS_KEY_ID="Your AWS Access Key ID"
export AWS_SECRET_ACCESS_KEY="Your AWS Secret Access Key"
export AWS_REGION="us-east-1"

Here's a simple example:

const dynamoose = require('dynamoose');

// Create cat model with default options
const Cat = dynamoose.model('Cat', {
  id: Number,
  name: String
});

// Create a new cat object
const garfield = new Cat({
  id: 666,
  name: 'Garfield'
});

// Save to DynamoDB
garfield.save(); // Returns a promise that resolves when save has completed

// Lookup in DynamoDB
Cat.get(666).then((badCat) => {
  console.log(`Never trust a smiling cat. - ${badCat.name}`);
});

API Docs

The documentation can be found at https://dynamoosejs.com/api/about/. You can also find additional examples at https://dynamoosejs.com/examples/about/.

Changelog

The Dynamoose Changelog can be found in the CHANGELOG.md file.

Roadmap

The Dynamoose Roadmap can be found in the ROADMAP.md file. Help is always appreciated on these items. If you are able to help submit a PR so we can review and improve Dynamoose!

Contributing

To contirubute to this project please checkout our CONTRIBUTING.md file.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文