- OrientDB - Console Modes
- OrientDB - Data Types
- OrientDB - Basic Concepts
- OrientDB - Installation
- OrientDB - Overview
- OrientDB - Home
OrientDB Database Commands
- OrientDB - Drop Database
- OrientDB - Optimize Database
- OrientDB - Rollback Database
- OrientDB - Commit Database
- OrientDB - Import Database
- OrientDB - Export Database
- OrientDB - Config Database
- OrientDB - Release Database
- OrientDB - Freeze Database
- OrientDB - List Database
- OrientDB - Info Database
- OrientDB - Disconnect Database
- OrientDB - Connect Database
- OrientDB - Restore Database
- OrientDB - Backup Database
- OrientDB - Alter Database
- OrientDB - Create Database
OrientDB Record Commands
- OrientDB - Delete Record
- OrientDB - Truncate Record
- OrientDB - Update Record
- OrientDB - Export Record
- OrientDB - Reload Record
- OrientDB - Load Record
- OrientDB - Display Records
- OrientDB - Insert Record
OrientDB Class Commands
OrientDB Cluster Commands
- OrientDB - Drop Cluster
- OrientDB - Truncate Cluster
- OrientDB - Alter Cluster
- OrientDB - Create Cluster
OrientDB Property Commands
OrientDB Vertex Commands
OrientDB Edge Commands
OrientDB Advanced Concepts
- OrientDB - Studio
- OrientDB - Security
- OrientDB - Upgrading
- OrientDB - Performance Tuning
- OrientDB - Logging
- OrientDB - Caching
- OrientDB - Hooks
- OrientDB - Transactions
- OrientDB - Indexes
- OrientDB - Sequences
- OrientDB - Functions
OrientDB Interfaces
OrientDB Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
OrientDB - Delete Edge
Delete edge command is used to remove the database. This is equivalent of the delete command, with the addition of checking and maintaining consistency with vertices by removing all cross-references to the edge from both ‘in’ and ‘out’ vertex properties.
The following statement is the basic syntax of Delete Edge command.
DELETE EDGE ( <rid> | [<rid> (, <rid>)*] | ( [ FROM (<rid> | <select_statement> ) ] [ TO ( <rid> | <select_statement> ) ] ) | [<class>] ( [WHERE <conditions>] [LIMIT <MaxRecords>] [BATCH <batch-size>] ))
Following are the details about the options in the above syntax.
FROM − Defines the starting point vertex of the edge to delete.
To − Defines the ending point vertex of the edge to delete.
WHERE − Defines the filtering conditions.
LIMIT − Defines the maximum number of edges to delete.
BATCH − Defines the block size for the operation.
Example
Try the following examples to learn how to delete edges.
Execute the following query to delete the edge between two vertices (#11:2, #11:10). But there might be a chance that might exist one or more edges between two vertices. So that we are using the date property for proper functionapty. This query will delete the edges which are created on 2015-01-15 and later.
orientdb {db = demo}> DELETE EDGE FROM #11:2 TO #11:10 WHERE date >= "2012-01-15"
If the above query is executed successfully, you will get the following output.
Delete record(s) 2 in 0.00200 sec(s)
Execute the following query to delete edges starting from the vertex ‘#11:5’ to the vertex ‘#11:10’ and which are related to ‘class = Customer’.
orientdb {db = demo}> DELETE EDGE FROM #11:5 TO #11:10 WHERE @class = Customer
If the above query is executed successfully, you will get the following output.
Delete record(s) 2 in 0.00200 sec(s)Advertisements