Page 3 of 4

Update and store

Posted: Wed Oct 30, 2013 6:36 pm
by Johnny

I did it and no luck.


Update and store

Posted: Wed Oct 30, 2013 9:52 pm
by Maryna Brodina

Hello! You have some problem with app logic. In listinsurance service in where parameter you pass userId, but there is no userId field in DB (there is just acl with such user, but it's hard to sort using it). You would need to add userId field in Insurance collection and use it to sort in where parameter of listinsurance service instead _id field.


Update and store

Posted: Thu Oct 31, 2013 6:15 am
by Johnny

Thank you for the help!

So just to make sure I understand. Must the user fill in his name on every screen with the other fields?

What if I create a ID field at registration where the user must give his indetification number. then I sort with that?


Update and store

Posted: Thu Oct 31, 2013 8:16 am
by Kateryna Grynko

Hi Johnny,

Appery.io will create a unique ID field for each user. You get this value when user login to your application.

You should:
a) add another field 'userId' to the collection 'Insurance'
b) save there the ID of user logged into the application (you can do it directly from localStorage, displaying it is not necessary)


Update and store

Posted: Thu Oct 31, 2013 8:18 am
by Johnny

Thank you, I will update the app and let you know how it works thank you for the help


Update and store

Posted: Wed Nov 06, 2013 1:35 pm
by Johnny

I done like you told me. It looks like that it is storing it correctly. But Im stuck at the list and update. How do I show only that user using the field I created in your step a.


Update and store

Posted: Wed Nov 06, 2013 2:25 pm
by Maryna Brodina

Hello! Use where parameter in http://docs.appery.io/documentation/b... request. Do sorting using this field pre{"userId" : "xxxxxxxxxx"}/pre you have userId stored in localStorage, so you need to retrieve it from localStorage


Update and store

Posted: Thu Nov 07, 2013 10:04 am
by Johnny

Sorry for my stupidity but how do I inpliment that examples like curl -X GET
-H "X-Appery-Database-Id: 526fdbd8e4b07c3286b537f1"
-G --data-urlencode 'where={"studentId": {"$lt": 50}}'
https://api.appery.io/1/db/collection...


Update and store

Posted: Thu Nov 07, 2013 11:08 am
by Maryna Brodina

Hello! It would be GET request with the following URL https://api.appery.io/1/db/collection... and two request parameters parameters.


Update and store

Posted: Fri Nov 08, 2013 7:59 am
by Johnny

From Yesterday when I received the url from you I get this.

Image