Page 1 of 2

Strange problems including related objects

Posted: Wed Sep 04, 2013 9:55 am
by Edwin Schravesande6028557

I'm kind of stuck on this problem. I think I know what I should do, but it just don't seem to work.

I'm trying to include a related object in a rest call, by adding a parameter 'include=RoundGroup', RoundGroup being the collumnname of a pointerfield. The thing is: I got one service working brilliantly with this method, the other one keeps returning this error message:

"code":"DBSQ203",
"description":"Collection 'RoundGroup' absent in database with id '51cd92a3e4b0901056be9216'."

Allright, I know there's no Collection with that name, the collection is called 'rounds_groups'. So let's try that, and 'include=rounds_groups'. But that gets me this message:

"code":"DBSQ237",
"description":"The column you are trying to include does not exist: 'rounds_groups'."

Yeah I know that's not the columnname! So here's where my thinking got into some infinit loop, that you might help me break.

Like I said, I got a working example proofing the first solution should be right, including the collumnname instead of the collection name.
You might think there won't be a problem if I had simular named collum names and collection names, but no, my working example proofs that's not nessesarily a problem.

The only logical difference between my functioning and disfunctioning service I can think of, is me using these caps in the collumnname.

I'm sort of clueless and it feels like maybe something buggy, but then again I'm probably just making some kind of stupid mistake.


Strange problems including related objects

Posted: Wed Sep 04, 2013 10:12 am
by Anton Artyukh5836028

Hi Edwin,

Can you show to us screenshot of Test tab?


Strange problems including related objects

Posted: Wed Sep 04, 2013 11:06 am
by Edwin Schravesande6028557

First here's the test without any include statement, showing my datastructure
Image

Now with include statement:

Image


Strange problems including related objects

Posted: Wed Sep 04, 2013 2:11 pm
by Anton Artyukh5836028

Check my example. In Table1 I have Pointer field to Users,
Image
And this is my request:
Image


Strange problems including related objects

Posted: Wed Sep 04, 2013 3:16 pm
by Edwin Schravesande6028557

Thanx a lot, but the thing is: I got a working example myself. And I just can't figure out any difference between the working and not working example. Except for maybe using UpperCase naming in the columns? Can you try that in your test set-up? Mine is a production environment.
But that'd be a strange kind of bug.

And then again, it might be me doing something stupid.

Though you got to admit: it's sort of a strange error message that doesn't really point to any error I made. First pointing out that it's not a collumnname, and than when you give it a collumnname, answering that it's not a collection name? It stil feels kind of buggy to me. Like the pointers are somehow corruptly pointing.


Strange problems including related objects

Posted: Wed Sep 04, 2013 5:17 pm
by Maryna Brodina

Hello!
[quote:]I just can't figure out any difference between the working and not working example. Except for maybe using UpperCase naming in the columns?[/quote] yes, it's case sensitive.

I'll update regarding your second question.


Strange problems including related objects

Posted: Wed Sep 04, 2013 5:49 pm
by Edwin Schravesande6028557

As I guessed it would be, and my references are correct for that matter.

I just wondered if the thing turns out to be buggy once you use any uppercase. But it's a long streched theory, I guess that's not an explanation. It's just the only tiny difference between my working examples and this failing service.

Just look at the screenshots I sent. In the first one, without the include argument, you see my data structure. Default a pointer sends back
"RoundGroup":{
"collName":"RoundGroup",
"_id":"521e391de4b0899403ce8765"
},

So that's what to include: the collName. No way around, is there? So that's what I do, include : RoundGroup.

Gives the error you see in the second screenshot. What could possibly be wrong? I know that's a lame kind of question, but I really can't find it.

Here's what you see in my database. The pointer to User has got the same problems.

Image


Strange problems including related objects

Posted: Thu Sep 05, 2013 6:33 am
by Edwin Schravesande6028557

I build a test app myself to find out.

  • for sure it's got nothing to do with caps
  • it's got nothing to do with mapping, it's happening without any mapping
  • it's got nothing to do with the specific app, querying the same database from a new app gives the same problem.
  • It happens both on Read an Query services.
  • It even happens with the include syntax thats automatically generated when importing a database service.

Strange problems including related objects

Posted: Thu Sep 05, 2013 7:14 am
by Edwin Schravesande6028557

So if you're willing to look into it, I'd better share my database, and then I guess you'll be able to reproduce the problem when querying this particular table. If you could hand me an e-mail-adress to share it with...


Strange problems including related objects

Posted: Thu Sep 05, 2013 2:24 pm
by Anton Artyukh5836028

Please share app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a or send to us backup of project where you can see this issue.