You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL ADD and REMOVE operators are not supported on lists #822
This part was totally missing in the SQL engine, and also from OrientDB... Instead of using ADD and REMOVE, we're going to use the more natural syntax with + and - to respectively add and remove element from a collection.
Same for += and -=. Exampls:
insert into test set listStrings = ['this', 'is', 'a', 'test'], listNumbers = [1,2,3]"update test set listStrings += '!', listNumbers += 9"update test set listStrings = listStrings +'!', listNumbers = listNumbers +9"
The same will work with maps:
insert into test set map = {'name':'Jay'}
update test set map += { 'last': 'Miner'}
update test set map += [ 'country', 'USA']
update test set map -= { 'last': 'Miner'} // REMOVE ALL THE ENTRIES THAT MATCH BOTH KEY AND VALUE PAIRS
update test set map -= [ 'country' ] // TO REMOVE BY KEY, JUST USE COLLECTION OF KEYS
I wasn't sure that syntax taken from OrientDB was still working! Maps, by choice, can only have strings as keys. You could convert the date->long->string, like "232723723723723". Or by doing the .toString() to a LocalDateTime produces a string in, I believe, the ISO format.
Activity
feat: support for + and - operators against collections and maps
topofocus commentedon Feb 3, 2023
Maps got a
addfunctionality in the pastadds the key/value-pair to a embedded map
works even with
implemented it recently in the ruby-adapter
I wanted to ask, how to add date-values as key to a map.
This is hopefully supported after the changes
lvca commentedon Feb 3, 2023
I wasn't sure that syntax taken from OrientDB was still working! Maps, by choice, can only have strings as keys. You could convert the date->long->string, like "232723723723723". Or by doing the .toString() to a LocalDateTime produces a string in, I believe, the ISO format.
topofocus commentedon Feb 3, 2023
Thats interesting. Thanks for clarification.
topofocus commentedon Mar 7, 2023
The case seems not completely solved:
The Map is exchanged, not updated:
The expected output:
Or do I miss something?
chore(deps): bump io.github.ascopes:protobuf-maven-plugin from 3.10.0…
feat: support for + and - operators against collections and maps
chore(deps): bump io.github.ascopes:protobuf-maven-plugin from 3.10.0…