Queries, also known as filters, are strings that are appended in the request as query parameters. Sitefinity JS SDK allows you to build queries programmatically.
Queries can be built with functions such as skip(), take(), count(), order(), select(), and where().
skip()
take()
count()
order()
select()
where()
NOTE: All queries that use the where() clause are implicitly followed by an and() operand. For example the query query.where().and().endswith("Title", "Record").done().done() produces the string (endswith(Title, 'Record')), which has a set of unused parenthesis - the outermost ones.
and()
query.where().and().endswith("Title", "Record").done().done()
(endswith(Title, 'Record'))
This article uses as example a query that returns items whose title ends with Record AND the age of the item is not equal to 15 OR the content equals test.
You build and use this query in the following way:
Query()
Sitefinity
Query
endwith
or
ne
eq
The .done() functions are used to specify where the operation ends. It is required so that the filter can be closed. Each time you use an and() or an or() operand you must add a done().
.done()
or()
done()
build()
GET
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important