Console - DICTIONARY PUT

Binds a record to a key in the dictionary database, making it accessible to the DICTIONARY GET command.

Syntax

  1. DICTIONARY PUT <key> <record-id>
  • <key> Defines the key you want to bind.
  • <record-id> Defines the ID for the record you want to bind to the key.

Example

  • In the database dictionary of U.S. presidents, bind the record for Barack Obama to the key obama:

    1. orientdb> DICTIONARY PUT obama 5:4
    2.  
    3. ------------------------------------------------------------------------
    4. Class: Person id: 5:4 v.1
    5. ------------------------------------------------------------------------
    6. parent : null
    7. children : [Person@5:5{parent:Person@5:4,children:null,name:Malia Ann,
    8. surname:Obama,city:null}, Person@5:6{parent:Person@5:4,
    9. children:null,name:Natasha,surname:Obama,city:null}]
    10. name : Barack
    11. surname : Obama
    12. city : City@-6:2{name:Honolulu}
    13. ------------------------------------------------------------------------
    14. The entry obama=5:4 has been inserted in the database dictionary

To see all the keys stored in the database dictionary, use the DICTIONARY KEYS command. For more information on dictionaries and indexes, see Indexes.

For more information on other commands, see Console Commands.