pimaxdev
Posts: 0
Joined: Mon Sep 02, 2013 4:56 pm

Problem with LIST service and userid

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Problem with LIST service and userid

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

pimaxdev
Posts: 0
Joined: Mon Sep 02, 2013 4:56 pm

Problem with LIST service and userid

Some snapshots about settings ...

Image Image

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

Problem with LIST service and userid

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.

pimaxdev
Posts: 0
Joined: Mon Sep 02, 2013 4:56 pm

Problem with LIST service and userid

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

pimaxdev
Posts: 0
Joined: Mon Sep 02, 2013 4:56 pm

Problem with LIST service and userid

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"}' ???

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Problem with LIST service and userid

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

pimaxdev
Posts: 0
Joined: Mon Sep 02, 2013 4:56 pm

Problem with LIST service and userid

Thanks !! but i have this result ...

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Problem with LIST service and userid

Hello,

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

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

Return to “Issues”