GithubHelp home page GithubHelp logo

dynamo's People

Contributors

andrewjstone avatar arnklint avatar dustyleary avatar gergold avatar jed avatar mhart avatar mlogan avatar timbertson avatar yjh0502 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamo's Issues

schema specification shouldn't rely on object key order

The current API pays relies key order in the schema parameter passed to new db.Table().

However, this can fail on an ECMA-262 5th Ed. complaint interpreter. Perhaps it should be changed to a list:

recipeTable = new db.Table({
   name:  "recipes",
   schema: [ {userId: Number}, {date: String} ] // key order insensitive
   throughput: {read: 10, write: 10}
})

error getting started

`healthy: dynamodb.eu-west-1.amazonaws.com
^

SyntaxError: Unexpected token h
at Object.parse (native)
at IncomingMessage. (/Users/arpecop/Desktop/API/lambda/zanimaime/node_modules/dynamo/lib/Request.js:37:36)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at doNTCallback2 (node.js:450:9)
at process._tickCallback (node.js:364:17)`

error while retrieving and adding data

Hello
I was trying to use dynamo module for a little class project but its not working and giving a unusual error "healthy: dynamodb.us-east-1.amazonaws.com
^
SyntaxError: Unexpected token h "

I am all torn out seeking out the reason for this error.
Please let me know what could be the possible error.
here is the code that i have been trying to use
var dynamo = require("dynamo")
, client = dynamo.createClient()
, db = client.get("us-east-1")

db.createTable({
TableName: "DYNAMO_TEST_TABLE_1",

ProvisionedThroughput: {
ReadCapacityUnits: 5,
WriteCapacityUnits: 5
},

KeySchema: {
HashKeyElement: {
AttributeName: "hash",
AttributeType: "S"
}
}
}, function(err, data){ ... }

Thanks and regards

publish latest to npm

Hi Jed,

Can you please publish the latest to npm with the fix from this commit?

51b871a

I just spent quite a while tracking down this bug, only to realize it was already fixed on github.

Thanks a bunch.

Predicates + Update.when()

I tried to use the method item.when(predicates).
In every version passed the predicate object i could not generate a valid conditional request like:

Expected: { id: { Exists: false } }

So i check your code and found out you forcing the value of the predicate to an array. Predicate.js:39

So it's only possible to get the operator = NE or EQ, witch where necessary to the item.when(), if you pass something like this:

new Predicate( { id: { "!=": [ undefined ] } } ) // a like bit weird ;-)

Now the problem

Within the Update.js:28 you check for null in combination with NEor EQ. I think that this can never be reached with the current predicate implementation.

A small rewrite to make it possible to generate a valid conditional request Update.js:28:

 if (value === null || value === undefined) {

But this is not really a nice solution.

Can you check the method item.when() for conditional requests or can you tell me how to use them.

How can I use pagination?

I know that DynamoDB has limit of 100 items GET.

And it returns continuing key to continue to fetch

next 100 results.

"Dynamo" says It aims to abstract DynamoDB's implementation (request signing, session tokens, pagination)

How can you do pagination by using Dynamo ? Can you provide me an example?

low level API - listTables error

I get an error that the first argument to db.listTables(args,callback) should be a string. When I put the empty string, it seems to work, but this shouldn't be necessary. I am new to all this so another explanation is that I'm not making any sense....

Also, fleshing out the low-level api with some examples would be very helpful. I'm not exactly sure what the arguments should be like for many of the functions.

High level Api no longer usable?

I installed everything last week and it worked like a charm, today I run the npm install dynamo in a new laptop and the same code is no longer running.
If I run

var dynamo = require("dynamo"), 
       client = dynamo.createClient({
        accessKeyId: "xxxxx",
        secretAccessKey: "xxxxxx"
    }),
    db = client.get("ap-northeast-1");

client.get is raising this error

../dynamo/node_modules/dynamo-client/index.js:247
throw new Error("No secret access key available.")
^
Error: No secret access key available.

So I was playing around with the different options and I found out that if I write

var dynamo = require("dynamo"), 
       client = dynamo.createClient("ap-northeast-1",
        {
        accessKeyId: "xxxxx",
        secretAccessKey: "xxxxxx"
    })

It works. This is the way dynamo-client is creating the object, so I'm not sure if the High level Api is still usable.

Also if I run

client = dynamo.createClient("ap-northeast-1",
        {
        accessKeyId: "xxxx",
        secretAccessKey: "xxxx"
    }),
    db = client.get("ap-northeast-1");

It will complain with this error

db = client.get("ap-northeast-1");
^
TypeError: Object # has no method 'get'

So looks like some of the methods are no longer available
Am I doing something wrong?

Thanks for the hard work!

keep track of capacity units

the capacity units consumed per operation are currently undersupported. would be nice to make these more visible in the high-level API.

error in readme

in the first code section 'table.name' should actually be 'table.TableName'

createClient() with optional sessionToken

For the use case of using dynamo via command line program running in a shell, it would be nice to be able to pass an optional saved session token when creating a client in order not to get rate limited by AWS Security Token Service.

db = dynamo.createClient({
  accessKeyId: "...",
  secretAccessKey: "...",
  sessionToken: "..." // optional saved session token
});

clarify retry strategy

while currently undocumented, this library takes a different approach to retries using the (err, data, next) signature in callback functions. in this case, next is a function that has the currently specified query in a closure:

  • if err does not exist, next is used for iteration/pagination to get the next set of results.
  • if err does exist, next is a retry function that can be executed at user discretion

the idea behind diverging from other SDKs is that retrying shouldn't be baked into the library, but performed according to user policy. would love to get feedback on this before settling on it in the documentation.

Fail to get an item from dynamo table (parsing error?)

raw response from dynamoDB below fails when Attributes.prototype.parse(data)

{
ConsumedCapacityUnits: 0.5,
Item:
{
name: { S: 'Christian Lewis' },
id: { S: '28664d40-6195-11e1-8d85-0be46e39396b' },
screen_name: { S: 'Tyler Young' }
}
}

I'm suspecting it's to do with ConsumedCapacityUnits

Am I not supposed to do table.get(key).fetch(opts, cb)?

It's basically failing to parse the raw response from Dynamo with stacktrace below

TypeError: Object.keys called on non-object
at Function.keys (native)
at Object.parse (node_modules/dynamo/lib/Value.js:17:23)
at node_modules/dynamo/lib/Attributes.js:20:34
at Array.forEach (native)
at Object.parse (node_modules/dynamo/lib/Attributes.js:18:23)
at node_modules/dynamo/lib/Item.js:54:32
at node_modules/dynamo/lib/Database.js:67:44
at IncomingMessage. (node_modules/dynamo/lib/Request.js:38:43)

add support for other zones

amazon has added several zones (US, tokyo, singapore, ireland, etc.) since launch, which need to be supported.

Update with an attribute set to zero does not work

If you try to add 0 (zero) via an update command, you get the exception:

com.amazon.coral.validate#ValidationException: One or more parameter values were invalid: Only DELETE action is allowed when no attribute value is specified

I think the bug is in Update.js, line 60 when you check if "value" is true. Zero is false, so the value is never set.

Thanks for the great library!

require table schema

currently, tables are specified by name only, and the schema is inferred at query time.

it would probably be better to avoid issues like #9 by making table schemas mandatory, so that queries that violate the schema fail before execution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.