---
title: "Basic"
description: "Guide to performing basic read-only queries and configuring query policies in the Aerospike Node.js client."
---

# Basic

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

This page describes basic queries and how to create a new query policy.

## Basic queries

Basic queries are read-only queries that return records to the client. A client application makes an API request to start a read-only query. This request in turn initiates parallel requests to each node in the cluster. The result returns the current version of each record to the client.

## Policies

The concept of short and long queries was introduced in Database 6.0. See [Differences between short and long queries](https://aerospike.com/docs/develop/learn/queries#differences-between-short-and-long-queries) for more information.

Query policies can be passed on a per-request basis. Policy values can be set to create a [filter expression](https://aerospike.com/docs/develop/expressions/#record-filtering-with-expressions), to determine whether bin data is included with the response, identify a short versus long query, and more.

::: note
Unless supported by query policies, basic queries are not supported on prefer-rack namespaces.
:::

The following example creates a new query policy that defines a [record filter expression](https://aerospike.com/docs/develop/expressions/#record-filtering-with-expressions) that compares the length of the `shape` list in the `report` map and returns `true` if greater than `2`.

```js
const exp = Aerospike.exp;

const maps = Aerospike.maps;

// Create query policy with Filter Expression

const queryPolicy = new Aerospike.QueryPolicy({

  filterExpression: exp.gt(

    exp.lists.size(

      exp.maps.getByKey(

        exp.binMap("report"),

        exp.str("shape"),

        exp.type.LIST,

        maps.returnType.VALUE,

      ),

    ),

    exp.int(2),

  ),

});
```