How to use the dynamoose.setDDB function in dynamoose

To help you get started, we’ve selected a few dynamoose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dynamoosejs / dynamoose / manual_test / index.js View on Github external
// kitty.save().then((res) => console.log(typeof res)).catch((err) => console.error(err));
// kittyB.save().then((res) => console.log(typeof res)).catch((err) => console.error(err));





const sdk = dynamoose.aws.sdk; // require("aws-sdk");
sdk.config.update({
	"accessKeyId": "AKID",
	"secretAccessKey": "SECRET",
	"region": "us-east-1"
});
const ddb = new dynamoose.aws.sdk.DynamoDB({"endpoint": "http://localhost:8000"});
dynamoose.aws.ddb.set(ddb);
dynamooseOld.setDDB(ddb);

const Cat = dynamooseOld.model("Cat200", {"id": Number, "name": String, "breed": String}, {"create": false});
const CatB = new dynamoose.model("Cat200", {"id": Number, "name": String, "breed": String}, {"create": false});

async function main() {
	// const cat = new Cat({"id": 10, "other": "Test", "name": "test"});
	// console.log(cat);
	// const other = await cat.save();
	// console.log(other);
	// console.log(await Cat.get(10));

	// for (let i = 0; i < 1000; i++) {
	// 	const cat = new CatB({"id": i, "name": new Array(50000).fill("a").join("")});
	// 	await cat.save();
	// }

dynamoose

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

Unlicense
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis