I am running following code :
https://github.com/rjrodger/simpledb
var simpledb = require('simpledb');
var sys = require('sys');
sdb = new simpledb.SimpleDB({keyid:'kye'
,secret:'mysectkey'});
var str="select * from youngib where createdon is not null order by createdon desc limit 10";
sdb.select (str, function( error, result ) {
console.log('attr1 = '+sys.inspect(error));
console.log('result = '+sys.inspect(result));
});
if i run this in seperate file it run but if i run in my project it gives me this error ,why this error coming?
{ Code: 'SignatureDoesNotMatch',
Message: 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.' }
the problem was that there i have declare
Array.prototype.in_array = function(p_val) {
for(var i = 0, l = this.length; i < l; i++) {
if(this[i] == p_val) {
return true;
}
}
return false;
}
due to this it was not executing the simpledb , i don’t know why, if you know please tell me.
If you extend
Array.prototypeyou can get issues withfor ... inloops.For example:
The for in loop iterates over all properties. So basically your 3rd party code makes the assumption you have not extend on
Array.prototype.Extending native prototypes is bad practice for these reasons.
As for your
in_arraymethod you could useinstead.