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

- added support for delete All, update Attributes, Non numeric ID attribute of node and match all that supports IN type query #2

Merged
merged 1 commit into from
Feb 6, 2015

Conversation

denisbetsi
Copy link
Contributor

The existing code was attempting to treat all IDs as integers, in case of any string like GUID, it'd simply not work. So this version has support non numeric IDs

Match All, had a function passing filter data as parameter, so when sending a list of IDs in an array to search, it'd attempt to search inq:[array] which would produce no results. So had to re-write the search query for IN to function.

Updating attributes wasn't fully implemented and same for deleteAll which gets called occasionally even if you aren't deleting multiple items. This version includes support for those 2.

- added support for NON Numeric IDs
- fixed a non functional match ALL which required IN type query
- added support for updating attributes
BradleyFord added a commit that referenced this pull request Feb 6, 2015
- added support for delete All, update Attributes, Non numeric ID attribute of node and match all that supports IN type query
@BradleyFord BradleyFord merged commit f510305 into IndustrialCloudSolutions:master Feb 6, 2015
@haio
Copy link
Contributor

haio commented Feb 11, 2015

Hi, @denisbetsi this will simply replace the node with given attributes, it seems not what updateAttributes should do. The cypher support update node by
start n=node(id) set n += {data} return n

@denisbetsi
Copy link
Contributor Author

It's much quicker to replace all values instead of doing comparison of what has changed and then updating Changed only attributes. It can be modified to issue a query to return existing values and then do quick comparison and do an update of changed only attributes, however that will create additional overhead.

Currently it's doing the set n+={data} which in fact replaces entire content of the node vs updating individual attributes.

I do see an issue with this in multi user environment where one person updates let's say Name attribute and another one is issuing a later update on City, would cause name update to be overridden during the physical update.

@haio
Copy link
Contributor

haio commented Feb 11, 2015

I dont think n += {data} is doing comparison of what has changed and then updating Changed only attributes, it add new attribute if not exists, otherwise override it. And the current code is n = {data} which will replaces entire node. For example:
{ name: 'name' } += { age: 0 } will be { name: 'name', age: 0 }
{ name: 'name' } = { age: 0 } will be { age: 0 }
The first case is what updateAttributes should be.

@denisbetsi
Copy link
Contributor Author

Modified updateAttributes now to support update on changed attributes only

#3

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.

3 participants