UDF stream is empty

Hello guys i have registerd UDF (Nodejs client), but when i apply that UDF stream is always null

    asclient.client.udfRegister('./lua/lm.lua', function (error) {
	  if (error) {
		console.error('Error: %s [%d]', error.message, error.code)
	  }
	});

Above is my udf registration and when i aql > show modules i see its loaded. After that i try to apply this

var key = new Key(‘chat’, ‘conversations’, 1); var udf = { module: ‘lm’, funcname: ‘getlm’, args: [ctoken]}

asclient.client.apply(key, udf, function (error, result) {
  if (error) throw error
	console.log(result);
  })

But always return null Here is my lua file content

function getlm(stream, conversation)

	return stream
end

I just return the strem to check if there is some data, but is empty… Hope that info helps.

You cannot return back a ‘stream’.

Than how to check if my script works ? if u put this

function getlm(stream, conversation)

	local function transformer(rec)
        local touple = map()
        touple["1"] = rec["1"]
        touple["2"] = rec["2"]
        touple["3"] = rec["3"]
        return touple
    end
	
	return stream:map(transformer)
end

Map the fields and i get error like

AerospikeError: /opt/aerospike/usr/udf/lua/lm.lua:17: attempt to call method 'map' (a nil value)

continue here: node.js - Aerospike Nodejs register UDF with .lua file - Stack Overflow