1.1.0 • Published 4 years ago
@quantilope/dynamoose-models v1.1.0
dynamoose-models
Example
Summary
To understand how to use these models, refer to the dynamoose docs.
import {
createDeployedInfrastructureModel
} from '@quantilope/dynamoose-models';
// The function returns a Dynamoose model, so check out the dynamoose docs on
// how to use it.
const DeployedInfrastructure = createDeployedInfrastructureModel();
Create a new entry
const newInfrastructureEntry = new DeployedInfrastructure({
id: process.env.INFRASTRUCTURE_ID,
sshdHost,
gottyHost
});
await newInfrastructureEntry.save();
Find an entry
// You get the object containing the document directly
const existingInfrastructure = await DeployedInfrastructure
.queryOne('id').eq('myInfraId')
.exec();
Find many entries
// You get an array of documents
const deployedInfrastructures = await DeployedInfrastructure
.scan()
.exec();
Publishing
We are using @pika/pack, so to build and release new version of this package:
# pack build
$ npm run build
# pack publish
$ npm run release