Page 1 of 1

Something corrupt in my pointers again, pls help

Posted: Sun Sep 08, 2013 10:06 am
by Edwin Schravesande6028557

Hey there,

This week I stumbled on some dirty little problem, that was solved by some magic trick of Marina. Something that appeared to be a problem on your side. See this conversation.

https://getsatisfaction.com/apperyio/...

The problem was wonderfully fixed on Friday, but sort of suddenly returned this morning. Could you check out what you can do? I guess you still can access both database and test app, but I'm not sure if that's nessesary.


Something corrupt in my pointers again, pls help

Posted: Sun Sep 08, 2013 10:13 am
by Edwin Schravesande6028557

I'm somehow warped back some hours work on my app too. I'm not sure what happened, but I deffinitely tested the scripts I wrote front end, so I did save them. I didn't make a version though.


Something corrupt in my pointers again, pls help

Posted: Sun Sep 08, 2013 11:57 am
by Igor

Hi,

We'll check but it will take some time.


Something corrupt in my pointers again, pls help

Posted: Sun Sep 08, 2013 12:48 pm
by Edwin Schravesande6028557

Thanx a lot!


Something corrupt in my pointers again, pls help

Posted: Mon Sep 09, 2013 7:45 am
by Maryna Brodina

Hello! We manually fixed it in DB again. You have to save JSON into RoundGroup column:
code{
"collName": "rounds_groups":
"id" : "111111111111111111111"
}/code
Looks like the problem is that you have code"collName": "RoundGroup"/code which leads to the error "Collection 'RoundGroup' absent".
The same is in User column, it should have the following structure:
code{
"collName": "users":
"_id" : "111111111111111111111"
}/code


Something corrupt in my pointers again, pls help

Posted: Mon Sep 09, 2013 8:34 am
by Edwin Schravesande6028557

There's like two ways I filled pointer fields. Some manually in the database GUI, some with script. With this explanation of what's wrong, I think I understand what's causing it too. So thanx a lot, I'll go posting JSON structures instead of id's when building a pointer, and guess that will be a sufficient sollution.

But just to get it straight: do I understand you right that

  • the GUI is automatically building this JSON structure if you just post an id, but you do have to post it as a complete JSON structure if you're scripting?

  • I wouldn't see the difference between one or the other in de database GUI?

    I wonder why I didn't see this problem in the data when querying the whole thing in a REST call. I probably overlooked these problems.


Something corrupt in my pointers again, pls help

Posted: Mon Sep 09, 2013 1:31 pm
by Maryna Brodina

Hi,
[quote:]the GUI is automatically building this JSON structure if you just post an id, but you do have to post it as a complete JSON structure if you're scripting? [/quote]
when you add value to Pointer column through GUI you just need to specify ID. If you add through REST Service you have to post JSON structure.

[quote:]I wouldn't see the difference between one or the other in de database GUI?[/quote] yes, there is no way to see the difference between correct and incorrect pointer using GUI.


Something corrupt in my pointers again, pls help

Posted: Mon Sep 09, 2013 4:45 pm
by Edwin Schravesande6028557

That makes sense.

But it's sort of a peculiar that the database in fact does make a JSON pattern when saving a pointer when I'm just shooting in an _id without any JSON.

Only does it put the collumname of the collection you're querying (like you'd expect for a field called "collName"), where correctly it should be referring to the name of the collection it's pointing to.

Or in a sample:

This is what happens when shooting in a blank id: it's converted too
"NameOfCollumn":{
"collName":"NameOfCollumn",
"_id":"some_id"
},

Where it should be:
"NameOfCollumn":{
"_id":"some_id",
"collName":"nameOfCollection"
},

I guess I know how to fix my way around now, but it might be worth fixing this conversionprocess in appery too.
When some script is accepting blank id's as a value for a pointer field, and converting it to JSON, it would better do it's job correctly, wouldn't it? Or is my understanding of this issue somehow falling short?


Something corrupt in my pointers again, pls help

Posted: Mon Sep 09, 2013 7:39 pm
by Edwin Schravesande6028557

I'm totally sorry and sort of ashamed. I see I did mess this up myself anyway. It's not your conversionscript, but some lost code I wrote myself. So please forget about this last post.

Thanx a lot for all the trouble. It's been quite a tricky problem, but I did clean it up now.