Forum BigDB need help saving objects to database

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

need help saving objects to database

Postby kuvi » August 2nd, 2013, 6:25 am

hi, im unclear on how to save objects to the database, ive been successful in loading them, but i cant figure out where to go from there. in my example, im downloading my players experience from the database, adding 23 experience, then trying to save it back to the database (would like to do this in the most concatenated one-liner as possible)

_client.bigDB.load("PlayerObjects", profilename , function(thename) {

thename.experience += 23
thename.experience.save(false, false, callback , errorHandler )}

Also what would be the equivalent for the server c# code?
kuvi
 
Posts: 11
Joined: March 29th, 2011, 12:32 am

Re: need help saving objects to database

Postby Henrik » August 3rd, 2013, 2:00 am

On the serverside you an use the PlayerObjects property to access the PlayerObject of that player directly, so there it would be:

Code: Select all
player.PlayerObject.Set("experience", player.PlayerObject.GetInt("experience", 0) + 23).Save();
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to BigDB



cron