any way to store voting results using App42?

0 votes
In the flash game that I tried to create, I'm planning for a sort of a voting feature where the player can vote for a favourite character

the tutorial shows how to store a data in the database

is there a way to modify a data that's already in the database without querying the data?

example: there's a vote_score value of 1234, and when a user clicks the vote button, vote_score will be added to 1235 automatically

or should i query the data, add it by one and store the data again?

thanks, sorry if i'm unclear
asked Apr 8, 2014 in App42 Cloud API-BaaS by tdv (16 points)

1 Answer

0 votes

You can use updateByKeyValue method to update the docs. However in your case I would recommend to save every single user vote as seperate object in given collection. You have to just count total records in the collection to count the vote in this case.

You can count total records using findAllDocumentsCount method.

answered Apr 8, 2014 by ajay123 (899 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...