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

Relationship partial loading #47

Open
gordonkristan opened this issue Aug 2, 2014 · 2 comments
Open

Relationship partial loading #47

gordonkristan opened this issue Aug 2, 2014 · 2 comments

Comments

@gordonkristan
Copy link
Contributor

Add the ability for the store to accept partial records, merging them with old records. The number one use case for this is pagination. When 50 IDs are loaded, to load the next 50, there's no reason to re-load the old 50.

@gordonkristan
Copy link
Contributor Author

This should work for attributes as well as relationships. This way record updates don't have to return the full record.

@gordonkristan
Copy link
Contributor Author

I really hate the RFC6902 PATCH format, so I'm not going to use it in the normalized payload format. However, I do think we can do something similar (vs a Mongo like syntax).

{
    "id": "1",
    "type": "user",
    "op": "add",
    "type": "relationship",
    "property": "posts",
    "value": {
        "id": "10",
        "type": "post"
    }
}

These would possibly reside in a changes object. I'm thinking the format might move to something like this:

{
    "meta": {},
    "records": {},
    "changes": {
        "user": {
            "1": [
                {}, {}, {}
            ]
        }
    }
}

This would keep the changes grouped for easy loading.

@gordonkristan gordonkristan mentioned this issue Aug 19, 2014
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant