Answer result I can't see

Hello Chris, first congratulation for Coronium is a great tool. I am start with it.

I am working in program and I want utility Coronium for access a mongoDB and need create Users. My problem is that I don’t to be access to result of command.

local composer = require ‘composer’

local globals = require ‘modulos.globals’

local coronium = require ‘modulos.mod_coronium’

coronium:init({ appId = globals.appId, apiKey = globals.apiKey })

globals.coronium = coronium

coronium:registerUser ({email = “test@gmail.com”, password = “1234”})

local answer = coronium:getUser (“d90651f322”)

print (answer.result) – result  nill

Thank you and sorry for my English

You need to call getUser with a function callback in the following way to get all the fields of a given user.

 mc:getUser( “d90651f322”, 

   function(event)

      if not event.error then

         print( "objectId = " … event.result.objectId … " email = "  … event.result.email);

     else

         print(event.error)

     end

 end

);

Thank you asmirj. I am happy.

You need to call getUser with a function callback in the following way to get all the fields of a given user.

 mc:getUser( “d90651f322”, 

   function(event)

      if not event.error then

         print( "objectId = " … event.result.objectId … " email = "  … event.result.email);

     else

         print(event.error)

     end

 end

);

Thank you asmirj. I am happy.