Created
December 9, 2013 15:27
-
-
Save sponnet/7873953 to your computer and use it in GitHub Desktop.
dino findOne failure. Bug is present in model.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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