Skip to content

Instantly share code, notes, and snippets.

@sponnet
Created December 9, 2013 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sponnet/7873953 to your computer and use it in GitHub Desktop.
Save sponnet/7873953 to your computer and use it in GitHub Desktop.
dino findOne failure. Bug is present in model.js
var dino = require('dino');
var LoginAWSmodel = dino.model({
schema: dino.schema({
table: 'dino-test',
attributes: {
myhash: dino.types.string,
mydata: dino.types.string,
},
key: {
hash: 'myhash'
}
})
});
var dinoclient = dino.connection.create({
"accessKeyId": "******",
"secretAccessKey": "*******",
"region": "eu-west-1"
});
dino.connect({
"accessKeyId": "******",
"secretAccessKey": "*******",
"region": "eu-west-1"
});
LoginAWSmodel.schema.createTable({
readUnits: 1,
writeUnits: 1,
client: dinoclient
}, function(err) {
if (err) {
console.log("Error creating schema : " + err);
} else {
console.log("created schema...");
}
});
console.log("waiting 10s for table creation..");
setTimeout(function() {
LoginAWSmodel.findOne({
myhash: "anything"
}, function(err, data, units) {
if (err) {
console.log(err);
}else{
console.log("You'll never get here...");
}
});
}, 1000*10);
{
"name": "dino-tc",
"version": "0.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "BSD-2-Clause",
"dependencies": {
"dino": "~0.3.5"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment