How do I make one entry per device in my databases? I want the same entry to be updated instead of new entry getting cre
Bascially, input from every device using my app should be only in one entry. Same entry getting updated over and over again.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Bascially, input from every device using my app should be only in one entry. Same entry getting updated over and over again.
Hi Kamal,
Please clarify with more details, what do you want to implement as it's not very clear now.
I want to have a unique number given off to every device, so that when they give an input, it is stored in the database with the number.
When they put an input again, I wan't a javascript command to check for the numeber in the database and update it if is already there or else create it.
Hi Kamal,
Here is brief plan for you:
1 create collection with field "deviceId".
2 get deviceId in way you like.
3 make "query" request to the collection with "where" parameter "{deviceId: xxxxx}". Where xxx your deviceId from 2nd step.
4 on "success" event for this query service you need to check count of returned items. Code example:
pre
var count = data.length;
if(count == 0)
alert("there is no items with this deviceId")
else
alert("here is item with this deviceId");
/pre
5 then you can make other actions in accordance to your app logic.
Regarsd.