The query class is used for constructing queries.

Example

const query = new Sitefinity.Query();
const query0 = query.where().and().endsWith("Title", "Record").done().or().startsWith('Title', 'asd').done().done();
const query1 = query.where().or().endsWith("Record", "Title").ne('age', '15').eq('Content', 'test').done().done();
const query2 = query.where().and().endsWith("Title", "Record").done().done();
const query3 = query.where().endsWith("Record", "Title").or().ne('age', '15').eq('Content', 'test').done().done();
const query4 = query.where().not().endsWith("Record", "Title").done().and().not().eq('Content', 'test').done().done().done();
const query5 = query.where().not().and().endsWith("Record", "Title").eq('Content', 'test').done().done().done();
const query6 = query.select("Id", "Title", "Content").expand('Tags').order("Title desc").where().ne('Title', 'zzz').eq('Title', 'newTitle').done()//.count();
const query7 = query.order("Title desc").where().eq('Title', 'newTitleUPDATE1').done().select("Title", "Content");
const query8 = query.where().eq('Title', 'newTitleN11').done();

Hierarchy

Constructors

Properties

expandProperties: string[]
filter: WhereQuery<Query> = null
inlineCount: boolean
orderProperties: OrderProperty[] = null
searchValue: string = null
selectProperties: string[]
skipValue: number = null
takeValue: number = null

Methods

  • Returns {
        [key: string]: string;
    }

    • [key: string]: string
  • Parameters

    • setter: Function = null

    Returns any

  • Returns the total item count with the result. Used for paging.

    Parameters

    • inline: boolean = true

    Returns Query

  • Selects which navigation properties will be returned when querying the service.

    Parameters

    • Rest ...properties: string[]

    Returns QueryBase

  • Specifies the order by clause.

    Example

    order by single field
    order("Title desc")

    Example

    order by multiple fields
    order("Title desc", "Description asc")

    Parameters

    • Rest ...properties: string[]

    Returns Query

  • Searches for the items matching the specified expression.

    Parameters

    • value: string

    Returns Query

  • Selects which fields will be returned when querying the service.

    Parameters

    • Rest ...properties: string[]

    Returns QueryBase

  • Skips a certain number of items from the beginning before returning the rest of the items. Used for paging.

    Parameters

    • value: number

    Returns Query

  • Takes a specified number of items from the query result. Used for paging.

    Parameters

    • value: number

    Returns Query

  • Parameters

    • propPaths: string[]
    • allowNested: boolean = false

    Returns void

Generated using TypeDoc