Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

Including related object on the Users collection

I have created a user_read_service according to your documentation. In my Users table I added a pointer column to the agency collection. The REST service returns a response as expected but I can't get the include parameter to work.

{
"createdAt":"2013-03-29 17:40:43.918",
"id":"5100b21bh4b55ae32e264457",
"updatedAt":"2013-08-02 08:03:01.720",
"agency":{
"collName":"agency",
"id":"5199b558e4b00dd32e2611b6"
},
"username":"x2xx"
}

I'd like the "acency" column to be fully included in the response.

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

Including related object on the Users collection

Hello! Did you create service manually or through Create New - Database Services? Could you also post DB screenshots (both tables) and REST service settings (Request and Test tabs)?

Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

Including related object on the Users collection

I had to create it manually because you can't create a new service from the Users table using the Create New - Database Services method.

Image

Image

Image

Image

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

Including related object on the Users collection

Hi Christo,

We suggest you to create a second request by received record _id as a workaround.

Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

Including related object on the Users collection

Is this a bug? Why does the system allow me to add pointer columns to the Users table while the include feature does not work? En extra request means extra calla to the back-end. I would rather not implement workarounds which would put a handicap on performance.

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

Including related object on the Users collection

Christo,

Sorry, we still don't know. We are searching.

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

Including related object on the Users collection

This is definitely a bug, will be fixed.

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

Including related object on the Users collection

Hi Christo,

This will be fixed in the nearest release. For now, there is a workaround. You can create a request with include if use the following URL in service:
code{database_url}/collections/_users/code

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

Including related object on the Users collection

Hello! This bug should be fixed now.

Return to “Issues”