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

How do I remove a certain element of a list? #8921

Closed
petervavro opened this issue Jun 23, 2019 · 1 comment
Closed

How do I remove a certain element of a list? #8921

petervavro opened this issue Jun 23, 2019 · 1 comment

Comments

@petervavro
Copy link

OrientDB Version: 3.0.19

Java Version: "11" 2018-09-25

OS: 10.14.4

My query is : SELECT fieldWithIds FROM TableA; where fieldWithIds is of LINKLIST type. Let's say it contains e.g. [#20:1,#20:2,#20:3,#20:4].

Is there a way to remove the element with index number 2 to get [#20:1,#20:2,#20:4]?

Thank you !

@luigidellaquila
Copy link
Member

Hi @petervavro

If you know the position of the item, then you can use square bracket filters (http://orientdb.com/docs/3.0.x/sql/SQL-Syntax.html#square-bracket-filters)

UPDATE TableA SET fieldWithIds = fieldWithIds[0..2] || fieldWithIds[3..1000000]

Thanks

Luigi

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

No branches or pull requests

2 participants