callback_ReadSimpleData()

Description

This async function is called when a read request is closed. If a document did not exist at the location, the data is (-1)(integer) and a struct of the data in that document otherwise.

Syntax

callback_ReadSimpleData(readId,data)
Argument
Description

readId

The id of this read request. This is an Integer.

data

Struct of the document.

Returns

N/A

Example Implementation

function callback_ReadSimpleData(readId,data){
	
	//if data is -1, the read failed, The Document was not found!
	//check the location(collection + document name) onceagain
	if(data == -1){
		show_message("failed read")
	}
	

	
	//the document is a struct in the variable data
	show_message("read id "+string(readId)+" : "+string(data))

}

Last updated