> For the complete documentation index, see [llms.txt](https://rocket-networking.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rocket-networking.gitbook.io/docs/rocket-networking-code/database-functions/callback_readsimpledata.md).

# 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` | <p>The id of this read request.<br>This is an Integer.</p> |
| `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))

}
```
