Page 1 of 2

Problem with LIST service and userid

Posted: Mon Sep 02, 2013 4:56 pm
by pimaxdev

My app do a QRSCAN and the save the result in the account of the logged user using appery database ...

when i want to list the user history with the " userid " ... i have an error " Collection 'QRCODE' doesn't contain object with id 51f28122.... " where the id is the local variable of the " userid "

Thanks for help !!


Problem with LIST service and userid

Posted: Mon Sep 02, 2013 5:48 pm
by maxkatz

Please post what you get in the Network tab [request] Headers


Problem with LIST service and userid

Posted: Tue Sep 03, 2013 8:37 am
by pimaxdev

Some snapshots about settings ...

Image Image


Problem with LIST service and userid

Posted: Tue Sep 03, 2013 2:14 pm
by Anton Artyukh5836028

Hello,

You need different query described here.

So do GET query for url: {database_url}/collections/QRCODE
with param where and value (need to be created as JS-code):
prereturn '{"user_id": "' + value + '"}';/pre
This example expect that your collection have simple string field with name user_id.
If you have Pointer object to Users collection, then use this additional info.


Problem with LIST service and userid

Posted: Thu Sep 05, 2013 9:31 am
by pimaxdev

i'm confused ! can you show me a better exemple ? what can i put in the request ? and JS-code in the invoke service ?? i don't understand ..

Thanks !!


Problem with LIST service and userid

Posted: Thu Sep 05, 2013 9:32 am
by pimaxdev

In the documentation :

curl -X GET
-H "X-Appery-Database-Id: 4ffcf6c8e4b0211629c4ad01"
-G --data-urlencode 'where={"priority": "High"}'
https://api.appery.io/rest/1/db/colle...

but where can i put the example 'where={"priority": "High"}' ???


Problem with LIST service and userid

Posted: Thu Sep 05, 2013 3:13 pm
by maxkatz

This will show you how to do it: http://docs.appery.io/tutorials/build...


Problem with LIST service and userid

Posted: Sat Sep 07, 2013 1:10 pm
by pimaxdev

Thanks !! but i have this result ...


Problem with LIST service and userid

Posted: Sat Sep 07, 2013 1:11 pm
by pimaxdev

Problem with LIST service and userid

Posted: Sat Sep 07, 2013 4:36 pm
by Igor

Hello,

Please try to use correct userid in WHERE clause. It should be something like this:

code
{"userid":"51f155ade4b0c2d8935a5a98"}
/code