---
title: "Datapoints.QueryInto"
description: "Query datapoints from one or more collections of the same dataset into a slice."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

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

# Datapoints.QueryInto

import { Fragment } from "astro/jsx-runtime";

import ApiReference from "@docs/components/ApiReference.astro";

import ParamField from "@docs/components/ParamField.astro";

```go
func (datapointClient) QueryInto(
    ctx context.Context,
    datasetID uuid.UUID,
    datapoints any,
    options ...datasets.QueryOption,
) error
```

Query datapoints from one or more collections of the same dataset into a slice.

QueryInto is a convenience function for [Query](/docs/api-reference/go/datasets/Datapoints.Query), when no manual pagination or custom iteration is required.

## Parameters

**datasetID**

type: uuid.UUID

The ID of the dataset to query.
**datapoints**

type: *[]proto.Message

The datapoints to query into
**options**

type: []datasets.QueryOption

Options for querying data points

## Options

**WithTemporalExtent(temporalExtent query.TemporalExtent)**

Specify the time interval for which data should be queried.
Right now, a temporal extent is required for every query.
**WithSpatialExtent(spatialExtent orb.Geometry)**

Specify the geographical extent in which to query data.
Optional, if not specified the query will return all results found globally.
**WithSpatialExtentFilter(spatialExtent query.SpatialExtent)**

Specify a geographical extent with an explicit [spatial filter mode](/docs/datasets/query/filter-by-location#spatial-filter-modes) and coordinate system.
**WithCollections(collections ...*datasets.Collection)**

Restrict the query to specific dataset collections by collection object.
**WithCollectionIDs(collectionIDs ...uuid.UUID)**

Restrict the query to specific dataset collections by collection ID.
**WithFilters(filters ...query.Expression)**

Filter by fields marked queryable in the dataset schema. Multiple expressions are combined with each other and with
temporal, spatial, and collection filters using logical AND.
**WithSkipData()**

default: false

Skip the data when querying datapoints.
If set, only the required and auto-generated fields will be returned.
**WithCursor(cursor *datasets.Cursor)**

Start the query after the cursor returned by a previous page.
**WithLimit(limit int64)**

Limit the total number of datapoints returned.

## Returns

An error if data points could not be queried.

See [Filter by custom fields](/docs/datasets/query/filter-by-fields) for comparisons, boolean expressions, and null checks.

<h2 id="request-example">Usage example</h2>

```go
import (
  "time"
  datasets "github.com/tilebox/tilebox-go/datasets/v1"
	"github.com/tilebox/tilebox-go/query"
)

startDate := time.Date(
    2014, 10, 4, 0, 0, 0, 0, time.UTC,
)
endDate := time.Date(
    2021, 2, 24, 0, 0, 0, 0, time.UTC,
)
queryInterval := query.NewTimeInterval(
    startDate,
    endDate,
)

var datapoints []*v1.Sentinel1Sar
err := client.Datapoints.QueryInto(ctx,
    dataset.ID,
    &datapoints,
    datasets.WithCollectionIDs(collection.ID),
    datasets.WithTemporalExtent(queryInterval),
)
```

Source: https://tilebox.com/docs/api-reference/go/datasets/Datapoints.QueryInto/index.mdx
