mogui / pyorient

Orientdb driver for python that uses the binary protocol.
Apache License 2.0
167 stars 127 forks source link

Create class command does not necessarily return cluster_id #205

Open nikulukani opened 8 years ago

nikulukani commented 8 years ago

In some examples in README.md and in some tests, cluster_id of a newly created class is assumed to be retrived via the following code

cluster_id = client.command( "create class my_class extends V" )

However, now that orientdb creates multiple clusters per class (controlled by the minimumclusters property, which by default equals the number of cores), the returned value is the number of classes and it does not correspond to cluster_id.

cluster_id (default) should instead be retrieved via something like the following if needed

cluster_id = DB.command("select classes[name='MyModel']"+\ ".defaultClusterId from 0:1")[0].oRecordData['classes']

Ostico commented 7 years ago

Known issue.

Refer to: https://github.com/orientechnologies/orientdb/issues/6258 https://github.com/mogui/pyorient/issues/201