Project: /docs/reference/js/_project.yaml
Book: /docs/reference/_book.yaml
page_type: reference
{% comment %}
DO NOT EDIT THIS FILE!
This is generated by the JS SDK team, and any local changes will be
overwritten. Changes should be made in the source code at
https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# QueryConstraint class
A `QueryConstraint` is used to narrow the set of documents returned by a Firestore query. `QueryConstraint`s are created by invoking [where()](./firestore.md#where_0fae4bf), [orderBy()](./firestore.md#orderby_006d61f), [startAt()](./firestore.md#startat_9a4477f), [startAfter()](./firestore.md#startafter_9a4477f), [endBefore()](./firestore.md#endbefore_9a4477f), [endAt()](./firestore.md#endat_9a4477f), [limit()](./firestore.md#limit_ec46c78), [limitToLast()](./firestore.md#limittolast_ec46c78) and can then be passed to [query()](./firestore.md#query_9f7b0f4) to create a new query instance that also contains this `QueryConstraint`.
Signature:
```typescript
export declare abstract class QueryConstraint
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [type](./firestore.queryconstraint.md#queryconstrainttype) | | [QueryConstraintType](./firestore.md#queryconstrainttype) | The type of this query constraint |
## QueryConstraint.type
The type of this query constraint
Signature:
```typescript
abstract readonly type: QueryConstraintType;
```