Skip to content

Latest commit

 

History

History
73 lines (50 loc) · 2.29 KB

constant.md

File metadata and controls

73 lines (50 loc) · 2.29 KB
title perex date author proofreading preferredLang
Constant filtering
If you need to retrieve entities by their entity primary keys, or verify that entities with particular primary keys exist in the database, the constant filter constraint is the place to go. Filtering entities by their primary keys is the fastest way to access entities in evitaDB.
26.5.2023
Ing. Jan Novotný
done
evitaql

Entity primary key in set

entityPrimaryKeyInSet(
    argument:int+
)
argument:int+
a mandatory set of entity primary keys representing the entities to be returned

The constraint limits the list of returned entities by exactly specifying their entity primary keys.

List of products filtered by entity primary key

The sample query returns products whose primary keys are declared in the entityPrimaryKeyInSet constraint. The order of the primary keys in the constraint doesn't matter. The returned entities are always returned in ascending order of their primary keys, unless the orderBy clause is used in the query.

If you want the entities to be returned in the exact order of the primary keys used in the argument of the entityPrimaryKeyInSet constraint, use the entityPrimaryKeyInFilter ordering constraint.

List of products filtered by entity primary key

Entities filtered by the primary keys

Entities filtered by the primary keys

Entities filtered by the primary keys