forked from orientechnologies/orientdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Console Command Update
lvca edited this page Dec 22, 2012
·
3 revisions
Update one or more records in the current database. Remember that Orient can work also in schema-less mode, so you can create any field on the fly.
update <class|cluster:<cluster>> set [<field-name> = <field-value>]([,])* [<conditions>](where)
For COLLECTIONS:
update <class|cluster:<cluster>> [[[,](add|remove]) <field-name> = <field-value>]* [<conditions>](where)
For MAPS:
update <class|cluster:<cluster>> [[[,](put|remove]) <field-name> = <map-key> [[where <conditions>](,<map-value>]]*)
Note that [must be prefixed with '#'. Example: #12:3.
To learn more about conditions look at SQLWhere WHERE conditions].
> update Profile set nick = 'Luca' where nick is null
Updated 2 record(s) in 0,008000 sec(s).
> update Profile remove nick
> update Account add addresses = #12:0
> update Account remove addresses = #12:0
> update Account put addresses = 'Luca', #12:0
> update Account remove addresses = 'Luca'
To learn more about the SQL syntax used by Orient take a look at: SQL-Query.
This is one of the commands of the Orient console. To see all the commands go to Console-Commands.