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.