Record Create - Class Property

97 views
Skip to first unread message

Giraldo Rosales

unread,
Jan 16, 2014, 5:32:20 PM1/16/14
to orient-...@googlegroups.com
How do we modify the @class property?

Trying to add a record using the binary. The record is added successfully with the following:
cluster id: 10
record content: "first:'Test', num:5"

Lets say cluster id #10 is a class called, "Users".

The record is added as #10:1 but the class field is empty. So in OrientDB Studio, when querying, "SELECT FROM Users" is executed, it will not show up. It will show up with, "SELECT FROM #10:1".

I would expect when calling RECORD_CREATE and adding the cluster id, it would also add the associated class automatically. If not, is there a way to add a property to the record content (ie. "'@class':'Users', first:'Test', num:5")? Am I doing something wrong?

Thanks!

Andrey Lomakin

unread,
Jan 17, 2014, 2:23:48 AM1/17/14
to orient-database
Hi,
The first question do you use your own binary client, is it correct ?


--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Giraldo Rosales

unread,
Jan 17, 2014, 3:35:38 AM1/17/14
to orient-...@googlegroups.com

Yes this is correct. I am using my own binary client.

You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/6BqAQx4P4wk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
Message has been deleted

Giraldo Rosales

unread,
Jan 17, 2014, 11:06:51 AM1/17/14
to orient-...@googlegroups.com
To clarify... I am using the pre-compiled version of 1.7 Luca just posted. Was assuming it wasn't a bug but just me not sending the correct parameters. Could not find an example online.

Thanks


On Friday, January 17, 2014 3:35:38 AM UTC-5, Giraldo Rosales wrote:

Yes this is correct. I am using my own binary client.

On Jan 17, 2014 2:24 AM, "Andrey Lomakin" <lomakin...@gmail.com> wrote:
Hi,
The first question do you use your own binary client, is it correct ?
On Fri, Jan 17, 2014 at 12:32 AM, Giraldo Rosales <nit...@gmail.com> wrote:
How do we modify the @class property?

Trying to add a record using the binary. The record is added successfully with the following:
cluster id: 10
record content: "first:'Test', num:5"

Lets say cluster id #10 is a class called, "Users".

The record is added as #10:1 but the class field is empty. So in OrientDB Studio, when querying, "SELECT FROM Users" is executed, it will not show up. It will show up with, "SELECT FROM #10:1".

I would expect when calling RECORD_CREATE and adding the cluster id, it would also add the associated class automatically. If not, is there a way to add a property to the record content (ie. "'@class':'Users', first:'Test', num:5")? Am I doing something wrong?

Thanks!

--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/6BqAQx4P4wk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-database+unsubscribe@googlegroups.com.

Andrey Lomakin

unread,
Jan 20, 2014, 9:48:25 AM1/20/14
to orient-database
Hi, 
If you use your own binary protocol, then you should send something like ''Users@first:'Test', num:5 
So you set class name, class separator and then fields.


To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Giraldo Rosales

unread,
Jan 20, 2014, 8:17:28 PM1/20/14
to orient-...@googlegroups.com
Thanks. Took some time to find it in the wiki. But what I couldn't understand (still figuring out the details of the database concept) is the distinction between classes and clusters. Clusters can exist without a class but a class cannot exist without a cluster.

So when you add a record to a cluster, you can do so without requiring it to be a part of a class. And once you add a record to a cluster without assigning it a class, you cannot assign that class later in a record update. You would have to delete the record and re-create it with the class.

In my scenario I was trying to add the class after the record was created. Which is why it wasn't working. This is not an issue but am curious if there is a reason a class wouldn't be automatically assigned. So if you add a record with one field, "first:'Test'" to cluster "3". Assuming the class, "Users", is assigned to cluster 3... ant the record is added as "#3:0". I was thinking it should technically be added as "Users@first:'Test'. 

The only reason I could see the database not doing this is if a developer wanted to fill a particular cluster with a mix of records with classes and without. Is this true?



On Monday, January 20, 2014 9:48:25 AM UTC-5, Andrey Lomakin wrote:
Hi, 
If you use your own binary protocol, then you should send something like ''Users@first:'Test', num:5 
So you set class name, class separator and then fields.
On Fri, Jan 17, 2014 at 6:06 PM, Giraldo Rosales <nit...@gmail.com> wrote:
To clarify... I am using the pre-compiled version of 1.7 Luca just posted. Was assuming it wasn't a bug but just me not sending the correct parameters. Could not find an example online.

Thanks


On Friday, January 17, 2014 3:35:38 AM UTC-5, Giraldo Rosales wrote:

Yes this is correct. I am using my own binary client.

On Jan 17, 2014 2:24 AM, "Andrey Lomakin" <lomakin...@gmail.com> wrote:
Hi,
The first question do you use your own binary client, is it correct ?
On Fri, Jan 17, 2014 at 12:32 AM, Giraldo Rosales <nit...@gmail.com> wrote:
How do we modify the @class property?

Trying to add a record using the binary. The record is added successfully with the following:
cluster id: 10
record content: "first:'Test', num:5"

Lets say cluster id #10 is a class called, "Users".

The record is added as #10:1 but the class field is empty. So in OrientDB Studio, when querying, "SELECT FROM Users" is executed, it will not show up. It will show up with, "SELECT FROM #10:1".

I would expect when calling RECORD_CREATE and adding the cluster id, it would also add the associated class automatically. If not, is there a way to add a property to the record content (ie. "'@class':'Users', first:'Test', num:5")? Am I doing something wrong?

Thanks!

--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/6BqAQx4P4wk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Andrey Lomakin

unread,
Feb 5, 2014, 8:56:32 AM2/5/14
to orient-database
Hi,
Good idea, because that is what we are planing to implement )) https://github.com/orientechnologies/orientdb/issues/1818

Giraldo Rosales

unread,
Feb 5, 2014, 9:12:39 AM2/5/14
to orient-...@googlegroups.com

Prefect! Great work!! The database keeps getting better. Can't wait for 2.0!

Thanks,
Giraldo

Reply all
Reply to author
Forward
0 new messages