Johnny
Posts: 0
Joined: Tue Jul 23, 2013 10:09 am

Update and store

I did it and no luck.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Update and store

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.

Johnny
Posts: 0
Joined: Tue Jul 23, 2013 10:09 am

Update and store

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Update and store

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)

Johnny
Posts: 0
Joined: Tue Jul 23, 2013 10:09 am

Update and store

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

Johnny
Posts: 0
Joined: Tue Jul 23, 2013 10:09 am

Update and store

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.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Update and store

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

Johnny
Posts: 0
Joined: Tue Jul 23, 2013 10:09 am

Update and store

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...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Update and store

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

Johnny
Posts: 0
Joined: Tue Jul 23, 2013 10:09 am

Update and store

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

Image

Return to “Issues”