CreateIndex

Creates a new index.

Parameters

  • index_type: Specifies if the index if for entities or connections.
  • class: Specified the class of the entity/connection.
  • property_key: Specifies the name of the property indexed.
  • [optional] property_type: Specifies the property type.

Details

This command checks if the index already exists and adds one if it doesn’t. The matches are case sensitive for all the parameters.

The index_type parameter can be either “entity” or “connection”.

The property_type parameters specified the data type for the index. The supported types are:

  • Integer (64bit integer)
  • Float (64bit floating point)
  • String
  • Boolean [true, false]
  • Time (ISO 8601 representation)

TODO Make sure the types strings matches with what the command expects in the implementation, which changes with v0.2.

property_type will be automatically inferred if there are existing objects with the specified property_key already defined.

Examples

Create an index for the String property “name” for the entities of the class “Person”:

[ {
    "CreateIndex" : {
        "index_type":    "entity",
        "class" :        "Person",
        "property_key" : "name",
        "property_type": "string"
    }
}]