Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Update value of firebase object

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20813

    Edward

    Hey!

    So I am handling nested data objects in my firebase database, I am currently reading the data by pushing into an array (calendarListModel) to work with within my app, a sample of this is;

     

    [ 
    {"date":1544443200000,"name":"Edward","status":1},
    {"date":1544529600000,"name":"Katie","status":0},
    {"date":1544616000000,"name":"Claire","status":1}
     ]

     

    I will be creating a list, populated by all entries with a status of 0 (false), which I am working on shortly

    there will be an accept/reject button for each entry, which will do either of the following;

     

    Accept Button: change status to 1 (true)

    Reject Button: Remove entry from database

     

    How could I update just the status value in firebase, or delete the entire entry? each entry is held by an id which is the time it was booked?

     

    Thanks

    Edd

     

     

    #20933

    Alex
    Felgo Team

    Hi,

    to delete entries from firebase you can simply set the value to an empty object {}. To update a value you can use the path to the value as key for the setValue function, which would be something like “id/status”

    Cheers,
    Alex

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.