Forum BigDB Creating from code BigDB properties with dots in their name?

Discussion and help relating to the PlayerIO database solution, BigDB.

Creating from code BigDB properties with dots in their name?

Postby ShadowVirtues » July 9th, 2018, 9:09 pm

We have a system of IDs in our game where it contains multiple sub-IDs separated by dots. For example: "1.2.3", "3.5.12". I am trying to write a script that creates a property of an object in BigDB having such ID as a name, but when I write stuff like:
Code: Select all
string ID = "1.2.3";
obj.Set(ID, "whatever");

it ends up creating nested objects. So, for this example I would get a database object named "1", having a nested object named "2", which in turn has a property named "3" that finally contains the value. But what I would like to have is only one root property with the name "1.2.3".
Image

Is it possible to tell PlayerIO to 'Set' from code a property with the name containing dots, without making it a nested object?

Thanks!
ShadowVirtues
 
Posts: 3
Joined: March 13th, 2018, 8:42 pm

Re: Creating from code BigDB properties with dots in their n

Postby ShadowVirtues » July 23rd, 2018, 5:00 pm

Then let's say I was able to create a property with the name containing dots, whether from code, or from browser. How can I also 'Get' the value of such property from code? Because it happens the same way, it can't get such object, since it appears to try to look into a nested object, which obviously doesn't exist.
Is it even possible to represent dots as 'characters' in whatever DatabaseObject API that contains 'string propertyExpression', instead of it being identified as referring to nested objects?
ShadowVirtues
 
Posts: 3
Joined: March 13th, 2018, 8:42 pm

Re: Creating from code BigDB properties with dots in their n

Postby Henrik » July 24th, 2018, 12:26 pm

No, the dot means nested objects in BigDB, and you can not have properties with a dot in their name.

The simplest solution for you is probably to replace . with some other character like - before you load or create BigDB objects.
Henrik
.IO
 
Posts: 1822
Joined: January 4th, 2010, 1:53 pm

Re: Creating from code BigDB properties with dots in their n

Postby ShadowVirtues » July 24th, 2018, 12:43 pm

That's what I figured I'd have to do in the end. Been replacing dots with commas for all property names.

Thanks a lot for the response anyway!
ShadowVirtues
 
Posts: 3
Joined: March 13th, 2018, 8:42 pm


Return to BigDB



cron