DELETE
Removes one or more records from the database. You can refine the set of records that it removes using the WHERE clause.
NOTE: Don't use
DELETEto remove Vertices or Edges. Instead use theDELETE VERTEXorDELETE EDGEcommands, which ensures the integrity of the graph.
Syntax:
DELETE FROM <Class>|CLUSTER:<cluster>|INDEX:<index> [LOCK <default|record>] [RETURN <returning>]
[WHERE <Condition>*] [LIMIT <MaxRecords>] [TIMEOUT <timeout>]
LOCKDetermines how the database locks the record between load and delete. It takes one of the following values:DEFAULTDefines no locks during the delete. In the case of concurrent deletes, the MVCC throws an exception.RECORDDefines record locks during the delete.
RETURNDefines what values the database returns. It takes one of the following values:COUNTReturns the number of deleted records. This is the default option.BEFOREReturns the number of records before the removal.
WHEREFilters to the records you want to delete.LIMITDefines the maximum number of records to delete.TIMEOUTDefines the time period to allow the operation to run, before it times out.
Examples:
Delete all recods with the surname
unknown, ignoring case:orientdb>DELETE FROM Profile WHERE surname.toLowerCase() = 'unknown'
For more information, see SQL commands.