Jacques van Niekerk
Posts: 0
Joined: Wed Apr 09, 2014 3:35 pm

Updating custom columns on User collection using server side script

I have defined custom columns on the pre-defined collection Users. When I try to update the custom columns using a server side script, I receive the following error message: " { [Error: Collection 'Users' absent in database with id 'xxxxxxx'.] code: 'DBSU203' }. The database id works correctly in other calls to the Collections API. How do I update the custom columns in the user collection using server side code ?

Jacques van Niekerk
Posts: 0
Joined: Wed Apr 09, 2014 3:35 pm

Updating custom columns on User collection using server side script

Here is the exact call I am making from the server side script: Collection.updateObject(dbid,"User", usr._id, customObject);

In this case customObject contains the data I wish to update. The error occurs because apparently the User collection cannot be found in the database with id dbid as mentioned above.
The question is - can one update the User collection using Collection.updateObject, and if not, how does one update custom fields in the User collection ?

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

Updating custom columns on User collection using server side script

Hello!
It's not possible to access predefined collections this way. Here is more information http://docs.appery.io/documentation/b...

Jacques van Niekerk
Posts: 0
Joined: Wed Apr 09, 2014 3:35 pm

Updating custom columns on User collection using server side script

OK - resolved. The following code works: DatabaseUser.update(dbid, usr._id, {"CustomColumn":customValue});
But please note that the documentation should state clearly that generic operations on Collections are NOT applicable to the pre-defined collections.

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

Updating custom columns on User collection using server side script

Thank you for update! We'll review docs!

Return to “Issues”