Miscellaneous Aql functions

Below is list of commonly used query functions:

  • “Aql.Like” – Similar to the SQL statement LIKE. Useful for text searches. Supports the wild card character “*”. The LIKE statement can be heavy on the database engine and cases where the data set is large (more than 10 000) and the field is of type LongStringDataValue we recommend you use IndexQuery instead. Here is an example:
WAFContext.Session.GetContents<ContentBase>(Aql.Like(AqlContent.Name, "Article*"));

 

  • “Aql.In” – Similarly to the SQL IN statement. It accepts lists of integer numbers. Useful for basing your query a given collection of nodeIds. Example: 
WAFContext.Session.GetContents<ContentBase>(Aql.In(1, 2, 3, 4, 5));

 

  • “Aql.MemberOf()”  - Is useful for check if a user is the member of a group specified in a property. Example:
WAFContext.Session.GetContents<ContentBase>(
   Aql.MemberOf(AqlContent.EditGroupId, WAFContext.Session.Access)
);

 

In this example the query will return all contents the current session have edit access to.