AQT

public indirect enum AQT

Abstract Query Tree.

Made to be easily readable/usable so that an AQT instance can be easily translated to a Document as a Query or even possibly SQL in the future.

  • Does the Value within the key match this Value

    Declaration

    Swift

    case valEquals(key: String, val: BSON.Primitive)
  • The Value within the key does not match this Value

    Declaration

    Swift

    case valNotEquals(key: String, val: BSON.Primitive)
  • Whether the Value within the key is greater than this Value

    Declaration

    Swift

    case greaterThan(key: String, val: BSON.Primitive)
  • Whether the Value within the key is greater than or equal to this Value

    Declaration

    Swift

    case greaterThanOrEqual(key: String, val: BSON.Primitive)
  • Whether the Value within the key is smaller than this Value

    Declaration

    Swift

    case smallerThan(key: String, val: BSON.Primitive)
  • Whether the Value within the key is smaller than or equal to this Value

    Declaration

    Swift

    case smallerThanOrEqual(key: String, val: BSON.Primitive)
  • Whether a subdocument in the array within the key matches one of the queries/filters

    Declaration

    Swift

    case containsElement(key: String, match: AQT)
  • and

    Whether all AQT Conditions are correct

    Declaration

    Swift

    case and([AQT])
  • or

    Whether any of these AQT conditions is correct

    Declaration

    Swift

    case or([AQT])
  • not

    Whether none of these AQT conditions are correct

    Declaration

    Swift

    case not(AQT)
  • Whether nothing needs to be matched. Is always true and just a placeholder

    Declaration

    Swift

    case nothing
  • Whether the String value within the key contains this String.

    Declaration

    Swift

    case contains(key: String, val: String, options: NSRegularExpression.Options)
  • Whether the String value within the key starts with this String.

    Declaration

    Swift

    case startsWith(key: String, val: String)
  • Whether the String value within the key ends with this String.

    Declaration

    Swift

    case endsWith(key: String, val: String)
  • A literal Document

    Declaration

    Swift

    case exactly(Document)
  • Value at this key exists, even if it is Null

    Declaration

    Swift

    case exists(key: String, exists: Bool)
  • in

    Value is one of the given values

    Declaration

    Swift

    case `in`(key: String, in: [BSON.Primitive])
  • Match all documents containing a key with geospatial data that is near the specified GeoJSON Point.

  • key the field name
  • point the GeoJSON Point
  • maxDistance : the maximum distance from the point, in meters
  • minDistance : the minimum distance from the point, in meters

  • Declaration

    Swift

    case near(key: String, point: Point, maxDistance: Double, minDistance: Double)
  • Match all documents containing a key with geospatial data that is near the specified GeoJSON point using spherical geometry.

  • point the GeoJSON Point
  • maxDistance : the maximum distance from the point, in meters
  • minDistance : the minimum distance from the point, in meters

  • Declaration

    Swift

    case nearSphere(key: String, point: Point,maxDistance: Double, minDistance: Double)