Skip to content

[QUERY] APPLY functions to node, e.g. for adding/removing node types #99

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

Closed
dantleech opened this issue Oct 3, 2014 · 2 comments · Fixed by #125
Closed

[QUERY] APPLY functions to node, e.g. for adding/removing node types #99

dantleech opened this issue Oct 3, 2014 · 2 comments · Fixed by #125
Labels
Milestone

Comments

@dantleech
Copy link
Member

Maybe we could do this by using the function mapping discussed in #90

UPDATE [nt:foo] APPLY nodetype_add('nt:barbar')
UPDATE [nt:foo] APPLY nodetype_remove('nt:barbar') WHERE x
UPDATE [nt:foo] APPLY do_something_copmpletely_different() WHERE y
UPDATE [nt:foo] APPLY nodetype_add('foo:bar'), property_set('foo', 'bar'), nodetype_remove('bar')
@dantleech dantleech changed the title [QUERY] Add grammer for adding node types [QUERY] APPLY functions to node, e.g. for adding/removing node types Oct 3, 2014
@dantleech
Copy link
Member Author

One really interesting application of this would be for migratin node types.

This would normally be done with setPrimaryType but this is not implemented in Jackalope yet, and more seriously not supported by Jackrabbit.

Such a function would mv the target node to a tempoary location create a node with the new type and then attempt to add the children of the old node to that node before deleting the original node.

UPDATE [nt:foo] AS a APPLY TO a migrate_primary_type('nt:newtype');

@dantleech
Copy link
Member Author

Addressed with #125

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

Successfully merging a pull request may close this issue.

1 participant