Page 2 of 3

Server Code and Pointers Error

Posted: Fri Jul 04, 2014 3:35 pm
by Bad Addy

Sorry Katya, but did you read the error at all ?

pre Error: '_id' is missing for pointer column 'groupType ( @ 66 : 18 ) - throw e/pre

The error is about the pointer column of the collection groups, and the fact its missing the _id. Using this in the app works perfectly, but for some reason its not working in server code. 'groupType' is sent via the app and sent to the server code service under the name 'groupTypeID'. Which is shown its sending it in console.log, and moved to 'group_type_id'.

I honestly do not understand your post at all, or how it could help fix this error!?!


Server Code and Pointers Error

Posted: Fri Jul 04, 2014 4:00 pm
by Kateryna Grynko

Addy,

Could you please share your app and Database?


Server Code and Pointers Error

Posted: Fri Jul 04, 2014 4:04 pm
by Bad Addy

app is already shared as is the database, urVoice and urVoice 3 respectively :)


Server Code and Pointers Error

Posted: Fri Jul 04, 2014 4:44 pm
by Kateryna Grynko

Addy,

What service should we test, with what data?


Server Code and Pointers Error

Posted: Fri Jul 04, 2014 4:49 pm
by Bad Addy

This is the service: urv_NewGroupAction which is fired on the page createGroup4 once the paypal payment is taken.


Server Code and Pointers Error

Posted: Fri Jul 04, 2014 7:22 pm
by Kateryna Grynko

Hi Addy,

1) You use method post in service while expect get in servercode. You would need to set get in service settings.
2) Remove extra request parameters of this service (data and Content-Type)
3) Add data for the following functions:
// Create User to Groups
// update Group
As you will get this error otherwise: "Error: Empty objects can't be created. Please specify at least one field."


Server Code and Pointers Error

Posted: Fri Jul 04, 2014 7:44 pm
by Bad Addy

I use server code a fair bit, and most of the time they are POST and all of those times the request.get works fine. So I am a little confused as to why it would cause an issue this time.

Removing the data and content-type is ok, but what do you mean Add data for the following functions. Data is added, so not sure I follow ?

Thanks


Server Code and Pointers Error

Posted: Fri Jul 04, 2014 8:58 pm
by Kateryna Grynko

Addy,

1) You can also use post, but then replace prerequest.get('groupTypeID');/preWith:prerequest.object().groupTypeID;/pre
2) Adding an object to collection 'group_owners' works and to 'users_groups' doesn't work because the first one has fields of string type and the second one has fields of pointer type that should be added in another way:
http://devcenter.appery.io/documentat...

3) There is a column 'users_id' in collection 'users_groups', while you use 'user_id' in code.


Server Code and Pointers Error

Posted: Sat Jul 05, 2014 6:58 pm
by Bad Addy

I understand, but I did not go past the first 'Create Group' yet, as that was what the error was about. I shall try the request.object() :)


Server Code and Pointers Error

Posted: Mon Jul 07, 2014 6:34 am
by Kateryna Grynko

Hello,

Did you get it working?