Table.select()
and
collection.find()
use different methods for
sorting results. Table.select()
follows the
SQL language naming and calls the sort method
orderBy()
.
Collection.find()
does not. Use the method
sort()
to sort the results returned by
Collection.find()
. Proximity with the SQL
standard is considered more important than API uniformity here.
The syntax for this function shown in EBNF is:
TableSelectFunction
::= '.select(' ProjectedSearchExprStrList? ')' ( '.where(' SearchConditionStr ')' )?
( '.groupBy(' SearchExprStrList ')' )? ( '.having(' SearchConditionStr ')' )?
( '.orderBy(' SortExprStrList ')' )? ( '.limit(' NumberOfRows ')' ( '.offset(' NumberOfRows ')' )? )?
( '.lockExclusive(' LockContention ')' | '.lockShared(' LockContention ')' )?
( '.bind(' ( PlaceholderValues ) ')' )*
( '.execute()' )?
The syntax for this function shown in EBNF is:
TableInsertFunction
::= '.insert(' ( TableFields )? ')'
( '.values(' ExprOrLiteral (',' ExprOrLiteral)* ')' )+
( '.execute()' )?
The syntax for this function shown in EBNF is:
TableUpdateFunction
::= '.update()'
( '.set(' TableField ',' ExprOrLiteral ')' )+ '.where(' SearchConditionStr ')'
( '.orderBy(' SortExprStrList ')' )? ( '.limit(' NumberOfRows ')' )?
( '.bind(' ( PlaceholderValues ) ')' )*
( '.execute()' )?