Functions

The following functions are available globally.

  • Equals

    Declaration

    Swift

    public func ==(key: String, pred: BSON.Primitive?) -> Query
  • Does not equal

    Declaration

    Swift

    public func !=(key: String, pred: BSON.Primitive?) -> Query
  • MongoDB: $gt. Used like native swift >

    Checks whether the Value in key is larger than the Value provided

    Declaration

    Swift

    public func >(key: String, pred: BSON.Primitive) -> Query

    Return Value

    A new Query requiring the Value in the key to be larger than the provided Value

  • MongoDB: $gte. Used like native swift >=

    Checks whether the Value in key is larger than or equal to the Value provided

    Declaration

    Swift

    public func >=(key: String, pred: BSON.Primitive) -> Query

    Return Value

    A new Query requiring the Value in the key to be larger than or equal to the provided Value

  • MongoDB: $lt. Used like native swift <

    Checks whether the Value in key is smaller than the Value provided

    Declaration

    Swift

    public func <(key: String, pred: BSON.Primitive) -> Query

    Return Value

    A new Query requiring the Value in the key to be smaller than the provided Value

  • MongoDB: $lte. Used like native swift <=

    Checks whether the Value in key is smaller than or equal to the Value provided

    Declaration

    Swift

    public func <=(key: String, pred: BSON.Primitive) -> Query

    Return Value

    A new Query requiring the Value in the key to be smaller than or equal to the provided Value

  • MongoDB $and. Used like native swift &&

    Checks whether both these Query statements are true

    Declaration

    Swift

    public func &&(lhs: Query, rhs: Query) -> Query

    Return Value

    A new Query that requires both the provided queries to be true

  • MongoDB: $or. Used like native swift ||

    Checks wither either of these Query statements is true

    Declaration

    Swift

    public func ||(lhs: Query, rhs: Query) -> Query

    Return Value

    A new Query that is true when at least one of the two queries is true

  • Whether the Query provided is false

    Declaration

    Swift

    public prefix func !(query: Query) -> Query

    Return Value

    A new Query that will be inverting the provided Query

  • MongoDB $and. Shorthand for lhs = lhs && rhs

    Checks whether both these Query statements are true

    Declaration

    Swift

    public func &=(lhs: inout Query, rhs: Query)
  • MongoDB $or. Shorthand for lhs = lhs || rhs

    Checks wither either of these Query statements is true

    Declaration

    Swift

    public func ||=(lhs: inout Query, rhs: Query)