Expression

Expression

Expression Objects

class Expression()
and
function and(args: ...*) -> 'object'

Arguments:

  • args …*

Returns:

  • object - This returns a json with the query of the logical operator "and" built.

Example:

Ex.and(Ex.like("collected.serialNumber", "SN"), Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"))


returns:

{
  and : [
    {
      like: {
        "collected.serialNumber": "SN"
      }
    },  
    {
      eq: {
        "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
      }
    }
  ]
}

eq
function eq(key: String,value: String) -> 'object'

Arguments:

  • key String - This is the name of the field
  • value String - This is the value of the field

Returns:

  • object - This returns a json with the query of the operator "eq" built.

Example:

Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25")


returns:

{
  eq : {
    "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
  }
}

gt
function gt(key: String,value: String) -> 'object'

Arguments:

  • key String - This is the name of the field
  • value String - This is the value of the field

Returns:

  • object - This returns a json with the query of the operator "gt" built.

Example:

Ex.gt("collected.imei", "123456786543210")


returns:

{
  gt : {
    "collected.imei": "123456786543210"
  }
}

gte
function gte(key: String,value: String) -> 'object'

Arguments:

  • key String - This is the name of the field
  • value String - This is the value of the field

Returns:

  • object - This returns a json with the query of the operator "gte" built.

Example:

Ex.gte("collected.imei", "123456786543210")


{
  gte : {
    "collected.imei": "123456786543210"
  }
}

in
function in(key: String,value: String) -> 'object'

Arguments:

  • key String - This is the name of the field
  • value String - This is the value of the field

Returns:

  • object - This returns a json with the query of the operator "in" built.

Example:

Ex.in("entityId", ["e64ccd08-e302-4b65-b19d-e38eeb7b2d24","e64ccd08-e302-4b65-b19d-e38eeb7b2d25"])


{
  in : {
    "entityId": ["e64ccd08-e302-4b65-b19d-e38eeb7b2d24","e64ccd08-e302-4b65-b19d-e38eeb7b2d25"]
  }
}

like
function like(key: String,value: String) -> 'object'

Arguments:

  • key String - This is the name of the field
  • value String - This is the value of the field

Returns:

  • object - This returns a json with the query of the operator "like" built.

Example:

Ex.like("collected.serialNumber", "SN")


returns:

{
  like : {
    "collected.serialNumber": "SN"
  }
}

lt
function lt(key: String,value: String) -> 'object'

Arguments:

  • key String - This is the name of the field
  • value String - This is the value of the field

Returns:

  • object - This returns a json with the query of the operator "lt" built.

Example:

Ex.lt("collected.imei", "123456786543210")


returns:

{
  lt : {
    "collected.imei": "123456786543210"
  }
}

lte
function lte(key: String,value: String) -> 'object'

Arguments:

  • key String - This is the name of the field
  • value String - This is the value of the field

Returns:

  • object - This returns a json with the query of the operator "lte" built.

Example:

Ex.lte("collected.imei", "123456786543210")


{
  lte : {
    "collected.imei": "123456786543210"
  }
}

neq
function neq(key: String,value: String) -> 'object'

Arguments:

  • key String - This is the name of the field
  • value String - This is the value of the field

Returns:

  • object - This returns a json with the query of the operator "neq" built.

Example:

Ex.neq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25")


returns:

{
  neq : {
    "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
  }
}

or
function or(args: ...*) -> 'object'

Arguments:

  • args …*

Returns:

  • object - This returns a json with the query of the logical operator "or" built.

Example:

Ex.or(Ex.like("collected.serialNumber", "SN"), Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"))


returns:

{
  or : [
    {
      like: {
        "collected.serialNumber": "SN"
      }
    },  
    {
      eq: {
        "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
      }
    }
  ]
}