Skip to content

cascading PUTs#73

Merged
ironspecs merged 1 commit intomasterfrom
cascasing-put
Jun 17, 2015
Merged

cascading PUTs#73
ironspecs merged 1 commit intomasterfrom
cascasing-put

Conversation

@ironspecs
Copy link
Contributor

Allow cascading PUTs, so that people can save things like this:

ref at { a: "b", c: {_ref: "d", e: "f"}}

which will produce two PUTs in this order:

ref at { a: "b", c: {_ref: "d"}}
d at { e: "f"}

If either PUT fails, they'll both fail.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just obj = {};?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it needs to be a particular object, specifically the one linked to by the original object. That's what it means by "in-place". Creating a new object might as well be {}, like you say.

In this case, there is a root object with many objects within it, and we're clearing those deep objects located somewhere deep within that root object. We don't know where these deep objects are -- they could even be within several layers of other objects within the root object.

@cruzanmo
Copy link

Looks good.

ironspecs added a commit that referenced this pull request Jun 17, 2015
@ironspecs ironspecs merged commit a54d607 into master Jun 17, 2015
@ironspecs ironspecs deleted the cascasing-put branch June 17, 2015 15:20
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

Successfully merging this pull request may close these issues.

2 participants