Michael Droll
Posts: 0
Joined: Wed Mar 04, 2015 5:05 am

Help with Include pointer from users collection

I'm having problems trying to recreate what Max has done in "Building Apps with the Appery io Database (January 28, 2015)" webinar posted on youtube.

I'm specifically trying to get the include user profile with a pointer to work. As best I can figure out he created a custom rest service to make this happen, I just cannot get it to work.

I get this when I try to test the service:
"status":403,
"uri":"https://api.appery.io/rest/1/db/users",
"response":{
"code":"DBUQ201",
"description":"Collection doesn't have READ permission."

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Help with Include pointer from users collection

Hello Michael,

We'll check this tutorial one more time and will get back to you with the update, but it may take some time.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Help with Include pointer from users collection

Hello,

Did you use header parameters "X-Appery-Database-Id" and "X-Appery-Session-Token" as described in tutorial (https://devcenter.appery.io/documenta...)?

Michael Droll
Posts: 0
Joined: Wed Mar 04, 2015 5:05 am

Help with Include pointer from users collection

yes I did .
Image
Here is the settings.
Image

Here is the query.
Image

Here is the test.
Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Help with Include pointer from users collection

Hi Michael,

Please check "Security and permissions" in your DB collection settings.

Details: http://prntscr.com/6rv6i5/direct

There should something like: http://prntscr.com/6rv6su/direct

Regards.

Michael Droll
Posts: 0
Joined: Wed Mar 04, 2015 5:05 am

Help with Include pointer from users collection

Ok that seams to have fixed it... sort of.

It is now including the pointer but it is returning the entire User collection not just the record in the pointer.

[
{
"id":"54fe0081e4b0798821a62b2a",
"username":"mdroll",
"createdAt":"2015-03-09 20:20:17.445",
"updatedAt":"2015-03-25 21:19:48.011",
"acl":{
"":{
"read":true
},
"54fe0081e4b0798821a62b2a":{
"read":true,
"write":true
}
},
"UserInfo":{
"id":"55132596e4b0e4b029ef1f3a",
"FirstName":"Michael",
"createdAt":"2015-03-25 21:16:06.190",
"updatedAt":"2015-03-25 21:18:22.080",
"LastName":"Droll",
"Email":"a href="mailto:droll.michael@gmail.com" rel="nofollow"droll.michael@gmail.com/a",
"Street":"8223 Thetford ln",
"City":"Houston",
"Zip":"77070",
"Phone":"8328591499",
"IsAgent":true,
"acl":{
"54fe0081e4b0798821a62b2a":{
"read":true,
"write":true
}
}
}
},
{
"id":"550a2ea5e4b03d3319f3816d",
"username":"PeteRemixed",
"createdAt":"2015-03-19 02:04:21.821",
"updatedAt":"2015-03-19 02:04:21.823",
"acl":{
"":{
"read":true
},
"550a2ea5e4b03d3319f3816d":{
"read":true,
"write":true
}
}
},
{
"id":"550db837e4b03d3319f3db13",
"username":"le1gf",
"createdAt":"2015-03-21 18:28:07.772",
"updatedAt":"2015-03-21 18:28:07.774",
"acl":{
"":{
"read":true
},
"550db837e4b03d3319f3db13":{
"read":true,
"write":true
}
}
},
{
"id":"5522d4d7e4b0c878de93588d",
"username":"test2",
"createdAt":"2015-04-06 18:47:51.656",
"updatedAt":"2015-04-06 18:47:51.658",
"acl":{
"":{
"read":true
},
"5522d4d7e4b0c878de93588d":{
"read":true,
"write":true
}
}
},
{
"id":"552487f5e4b01887fd84cc7b",
"username":"ron",
"createdAt":"2015-04-08 01:44:21.818",
"updatedAt":"2015-04-08 01:44:21.820",
"acl":{
"*":{
"read":true
},
"552487f5e4b01887fd84cc7b":{
"read":true,
"write":true
}
}
}
]

Michael Droll
Posts: 0
Joined: Wed Mar 04, 2015 5:05 am

Help with Include pointer from users collection

I figured it out. I needed to have a "where" in the request query instead of _id. It is now working as intended.

Thank you for the help!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Help with Include pointer from users collection

Hello Michael,

Thank you for the update, glad it works!

Jessi
Posts: 0
Joined: Fri Apr 24, 2015 5:38 am

Help with Include pointer from users collection

Hi guys.

I'm doing the same thing as Michael. But for mine, my profile(pointer to UserProfile) doesn't came out anything. And when i test it will only come out my username details and not my email and contact number. How to overcome this?

This is my database where the id wont come out for the profile(pointer)

Image

Image

and this is what i get when i test:

Image

Help??

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Help with Include pointer from users collection

Hi Jessi,

Here is what i see on your screen shots.
Details: http://prntscr.com/704yeu/direct

So that means you did not link user to userPrifile before. Thus you can not get this link in list/read service.

Regards.

Return to “Issues”