> ## Documentation Index
> Fetch the complete documentation index at: https://docs-old.tilebox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DatapointDecoder.Unmarshal

```go theme={"system"}
func (d datasets.DatapointDecoder) Unmarshal(
    descriptor *datasets.DatapointDescriptor,
    data []byte,
) (map[string]any, error)
```

Decode a raw protobuf datapoint into a JSON-like map with configurable protobuf decoding options.

## Parameters

**descriptor** `*datasets.DatapointDescriptor` *required*

The descriptor returned by [`NewDatapointDescriptor`](https://docs-old.tilebox.com/api-reference/go/datasets/NewDatapointDescriptor).

**data** `[]byte` *required*

The raw protobuf datapoint bytes returned by a datapoint query.

## Decoder options

**AllowPartial** `bool`

Allow messages that are missing required fields.

**DiscardUnknown** `bool`

Ignore unknown fields in the raw protobuf message.

**Resolver**

Override the resolver used to look up message and extension types.

**RecursionLimit** `int`

Limit how deeply nested messages may be decoded. A zero value uses the protobuf default.

## Returns

A map of datapoint fields, or an error if the raw datapoint cannot be decoded.

```go Go theme={"system"}
decoder := datasets.DatapointDecoder{
    DiscardUnknown: true,
}

datapoint, err := decoder.Unmarshal(descriptor, data)
if err != nil {
    return err
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.