diff --git a/src/doc/CaosDB-Query-Language.md b/src/doc/CaosDB-Query-Language.md index 824550bc22844721818dc2b4ebeb9eb8a1fcb789..415c555527a7b5dfcb049c507e39e8a639047550 100644 --- a/src/doc/CaosDB-Query-Language.md +++ b/src/doc/CaosDB-Query-Language.md @@ -4,20 +4,25 @@ See syntax specification in [CaosDB Query Language Syntax](query-syntax). ## Simple FIND Query -The following query will return any record which has the name _ename_ and all +The following query will return any record which has the name _somename_ and all record children of any entity with that name. -`FIND ename` +`FIND somename` -The following queries are equivalent to the former. Of course, the returned set of entities (henceforth referred to as _resultset_) can also be restricted to recordtypes, properties and files. +On server in the default configuration, the following queries are equivalent to this one. -`FIND RECORD ename` +`FIND RECORD somename` -`FIND RECORDS ename` +`FIND RECORDS somename` -You can include all entities (Records, RecordTypes, Properties, ...) into the results by adding the `ENTITY` keyword: +Of course, the returned set of entities (henceforth referred to as _resultset_) can also be +restricted to RecordTypes (`FIND RECORDTYPE ...`), Properties (`FIND PROPERTY ...`) and Files (`FIND +FILE ...`). -`FIND ENTITY ename`. +You can include all entities (Records, RecordTypes, Properties, ...) into the results by using the +`ENTITY` keyword: + +`FIND ENTITY somename` Wildcards use `*` for any characters or none at all. Wildcards for single characters (like the `_` wildcard from mysql) are not implemented yet. @@ -27,27 +32,29 @@ Regular expressions must be surrounded by _<<_ and _>>_: `FIND <<e[aemn]{2,5}>>` -`FIND <<[cC]am_[0-9]*>>` +`FIND <<[cC]amera_[0-9]*>>` -*TODO* (Timm): +*TODO*: Describe escape sequences like `\\\\ `, `\*`, `\<<` and `\>>`. -Currently, wildcards and regular expressions are only available for the _simple-find-part_ of the query, i. e. no wildcards/regexps for filters. +Currently, wildcards and regular expressions are only available for the _simple-find-part_ of the +query, i.e. not for property-operator-value filters (see below). ## Simple COUNT Query -Count queries count entities which have certain properties. +COUNT queries count entities which have certain properties. -`COUNT ... ename ...` +`COUNT ... rname ...` -will return the number of records which have the name _ename_ and all record +will return the number of records which have the name _rname_ and all record children of any entity with that name. The syntax of the COUNT queries is equivalent to the FIND queries in any respect (this also applies to wildcards and regular expressions) but one: The prefix is to be `COUNT` instead of `FIND`. -Unlike the FIND queries, the COUNT queries do not return any entities. The result of the query is the number of entities which _would be_ returned if the query was a FIND query. +Unlike the FIND queries, the COUNT queries do not return any entities. The result of the query is +the number of entities which _would be_ returned if the query was a FIND query. ## Filters