11.3 集合 CRUD 函數

CollectionFindFunction

此函數在 EBNF 中的語法為

CollectionFindFunction
  ::= '.find(' SearchConditionStr? ')' ( '.fields(' ProjectedDocumentExprStr ')' )?
      ( '.groupBy(' SearchExprStrList ')' )? ( '.having(' SearchConditionStr ')' )?
      ( '.sort(' SortExprStrList ')' )? ( '.limit(' NumberOfRows ')' ( '.offset(' NumberOfRows ')' )? )?
      ( '.lockExclusive(' LockContention ')' | '.lockShared(' LockContention ')' )? 
      ( '.bind(' PlaceholderValues ')' )*
      ( '.execute()' )?

圖 11.9 CollectionFindFunction

Image shows the syntax in EBNF form as described in the preceding text.

CollectionModifyFunction

此函數在 EBNF 中顯示的語法為

CollectionModifyFunction
  ::= '.modify(' SearchConditionStr ')'
      ( '.set(' DocPath ',' ExprOrLiteral ')' |
        '.unset(' DocPath ( ',' DocPath )* ')' |
        '.arrayInsert(' DocPath ',' ExprOrLiteral ')' |
        '.arrayAppend(' DocPath ',' ExprOrLiteral ')' |
        '.patch(' DocumentOrJSON ')'
      )+
      ( '.sort(' SortExprStrList ')' )? ( '.limit(' NumberOfRows ')' )?
      ( '.bind(' PlaceholderValues ')' )*
      ( '.execute()' )?

圖 11.10 CollectionModifyFunction

Image shows the syntax in EBNF form as described in the preceding text.

CollectionAddFunction

此函數在 EBNF 中顯示的語法為

CollectionAddFunction
    ::= ( '.add(' ( DocumentOrJSON | '[' DocumentOrJSON ( ',' DocumentOrJSON )* ']' )? ')' )+
        ( '.execute()' )?

圖 11.11 CollectionAddFunction

Image shows the syntax in EBNF form as described in the preceding text.

CollectionRemoveFunction

此函數在 EBNF 中顯示的語法為

CollectionRemoveFunction
    ::= '.remove(' SearchConditionStr ')'
        ( '.sort(' SortExprStrList ')' )? ( '.limit(' NumberOfRows ')' )?
        ( '.bind(' PlaceholderValues ')' )*
        ( '.execute()' )?

圖 11.12 CollectionRemoveFunction

Image shows the syntax in EBNF form as described in the preceding text.