pyorient icon indicating copy to clipboard operation
pyorient copied to clipboard

Create class command does not necessarily return cluster_id

Open nikulukani opened this issue 8 years ago • 1 comments

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']

nikulukani avatar Jul 31 '16 05:07 nikulukani

Known issue.

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

Ostico avatar Apr 29 '17 20:04 Ostico