Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't pass nested JSON Object #35

Open
WilliamMcCumstie opened this issue Jan 20, 2017 · 1 comment
Open

Can't pass nested JSON Object #35

WilliamMcCumstie opened this issue Jan 20, 2017 · 1 comment

Comments

@WilliamMcCumstie
Copy link

WilliamMcCumstie commented Jan 20, 2017

I noticed when you want to pass a nested JSON object with put item (also update item), it insert the object into the database as [object, object].

I haven't started looking into your code in to mush depth yet, but as aws can support nested json objects, it would worth looking into.

Example
Trying to insert the following object into a new table won't give any warnings

var object = {
	"id": "id",
	"num": 1,
	"str": "string",
	"Obj": {
		"num": 1,
		"str": "string"
	}
};
dynode.putItem("NewTable", object);

However amazon will show it inserted as:

{
  "id": "id",
  "num": 1,
  "Obj": "[object Object]",
  "str": "string"
}
@WilliamMcCumstie
Copy link
Author

My guess it something to do with the stringify in the putItem method

var request = util.mixin({}, {TableName: tableName, Item: Types.stringify(item)}, options);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant