retrieve

DatabaseUser.retrieve(dbId, objectId, include[,token])

Retrieves info about the user in the database.

#Parameters The method has the following parameters:

Argument Description

dbId

String with database id.

token

String with user token.

objectId

Unique identifier of the user that should be updated.

include

String parameter that indicates whether the referenced object should be included.

#Response This method has the following response:

{
   "username":"<username>",
   "_createdAt":"<datetime>",
   "_updatedAt":"<datetime>",
   "_id":"<user_id>"
}

Example

Retrieving info about the user.

// Code example
var dbId = "52776916a044652b54f1f976";
var username = "testUser10";
var password = "testUser10";

var token = DatabaseUser.login(dbId, username, password).sessionToken;

var user = DatabaseUser.retrieve(dbId, id, null, token);