Ubidots Developer Guides
Help CenterAPI ReferenceData APICommunity
  • Welcome to our Dev Guides
  • ⚡️ Getting Started
    • What is Ubidots?
    • Devices, Variables, and Dots
    • Technical FAQs
    • Business FAQs
  • 🧩Integration Guides
    • Industrial IoT
      • Advantech
      • Amplified Engineering
      • AWS
      • Azimut
      • Balena
      • Bivocom
      • CESVA
      • Controllino
      • Digital Communications Technologies (DCT)
      • Everactive
      • Golioth
      • Kepware
      • Kunbus
      • Monnit
      • MultiTech
      • NCD.io
      • Node-RED
      • Omicron IoT
      • Red Lion
      • Robustel
      • Senquip
      • Sielco
      • Siemens
      • Strega
      • vNode
      • WAGO
      • Weintek
      • YuDash
    • Cellular
      • Blues Wireless
      • Digi International
      • Hologram
      • Monogoto
      • Particle
      • Quectel
      • Soracom
    • LoRaWAN
      • AonChip
      • Chirpstack
      • Decentlab
      • Helium
      • ioThings
      • LORIOT
      • Milesight
      • MOKOSmart
      • RAKwireless
      • Sagemcom
      • Seeed Studio
      • Senet
      • The Things Industries
        • The Things Stack
        • The Things Network
    • Sigfox
      • Digital Matter
      • McThings
      • Sigfox
      • Suntech
      • Thinxtra
      • UnaBiz
    • Satellite
      • Swarm
    • Dev Kits
      • Adafruit
      • Advantech
      • AloriumTech
      • Arduino
      • Blues Wireless
      • DFRobot
      • Dragino
      • Electric Imp
      • Espressif Systems
      • McThings
      • Microchip Technology
      • Onion
      • Particle
      • Pycom
      • RAKwireless
      • Raspberry Pi
      • Seeed Studio
      • Sodaq
      • STMicroelectronics
      • Texas Instruments
      • Thinxtra
      • Verse Technology
    • Weather
      • Weather Plugins
      • Ambient Weather
    • Tools
      • Gambit Communications
      • PubNub
  • 📊Dashboards & Widgets
    • HTML Canvas
      • 3rd party packages
      • Preload Dashboard data
      • Built-in library
        • Properties
        • Methods
        • Listening events
        • API
      • Examples
        • Basics
        • Create an LCD screen with the HTML Canvas
        • Interacting with dashboard data
        • Change header's custom style
        • Adding real time using Socket.IO
        • Delete Variable data from a Device
        • Delete Variable data from Groups or Types of Devices
        • Navigation through Dashboard
        • Using a React library
      • Code editor
        • HTML Tab
        • CSS Tab
        • JavaScript Tab
    • Custom UI
      • Paragraph
      • Input combo
        • Text
        • Numeric
        • Numeric with buttons
        • Date
        • Time
        • Toggle
        • Dropdown
        • Multiple selection dropdown
      • Button
    • Custom Style
      • Dashboards
      • Widgets
    • Line chart
    • Pages
      • Getting started
      • Development
      • API
        • Page creation
        • Publish
  • 🤖UbiFunctions
    • Getting Started
      • Creating an UbiFunction
      • Coding an UbiFunction
      • Testing an UbiFunction
      • Authentication
      • Execution Time
      • Logs
    • Runtimes
      • Python
      • NodeJS
      • Custom Runtimes
    • Invocation
      • Time-based Trigger
      • HTTPS
      • MQTT Publish
      • Ubidots Event
    • Advanced
      • Account Token
      • Execution time
      • Raw Functions
      • CORS Policy
      • Async Execution
      • DaaS (Decoder as a Service)
      • Developing and Managing UbiFunctions with Ubidots CLI
    • Examples
    • Specs and Limits
    • Storage
      • File Storage API
      • Mutiple files
  • 🧩Plugins
    • What is a plugin?
    • Public vs. Private
    • Public plugins
      • Cron
      • Webhook
    • Private Plugins
      • Cron
      • Webhook
      • Widget
      • Device
    • Plugins development
      • Getting started
      • Cron
      • Webhook
      • Widget
      • Device
      • view.xml
      • view_widget.xml
    • Plugins deployment
      • Cron and Webhook
      • Widget
      • Device
    • Using the plugins
      • Cron and Webhook
      • Widget
      • Device
  • 📈SYNTHETIC VARIABLES
    • Getting started
      • Creating synthetic variables
      • Synthetic Variables' editor
    • Expressions
      • Mathematical
      • Date range
      • Rolling
      • Special functions
    • Specs and limits
    • Examples
      • Mathematical
      • Date range
      • Rolling
      • Special functions
  • ⌨️Developer tools
    • Javascript SDK
      • Overview
      • Getting started
      • Ubidots class
        • Get methods
        • Filter methods
        • Ubidots objects
          • Entity object
          • Paginator
      • Examples
    • CLI
      • Overview
      • Installing
      • Usage
      • SDK for UbiFunctions
  • 🏗️Apps
    • App builder
      • Custom sidebar
Powered by GitBook
On this page
  • Filter methods
  • Using where method
  • Using addRawParams method
  • Accessing the filters
  • ID
  • Boolean
  • Number
  • String
  • Array
  • Object
  • Date

Was this helpful?

Export as PDF
  1. Developer tools
  2. Javascript SDK
  3. Ubidots class

Filter methods

Use Ubidots field filters.

PreviousGet methodsNextUbidots objects

Last updated 6 months ago

Was this helpful?

The Ubidots API supports requests using , like this:

GET https://industrial.api.ubidots.com/api/v2.0/devices/?label__startswith=temp

This library also provides a way to construct custom requests that take advantage of these filters.

Filter methods

Filter method
Description
Usage
Arguments
Response

where

Applies a filter on a single property of the given entity

Ubidots.<entity>.where(<entity-property>).<filter>(<filter-value>).<get-method>(, [args])

A valid property of the given entity

addRawParams

Applies filters on multiple properties of the given entity

Ubidots.<entity>.addRawParams(<query-object>).<get-method>(, [args])

query-object: object An object containing queryparam-value pairs

Using where method

The example GET request shown at the top of this page can be replicated using the library's where method, like this:

const tempDevices = await Ubidots.devices.where('label').startsWith('temp').get();

Here:

  • <entity> = devices

  • <entity-property> = 'label'

  • <filter> = startsWith

  • <filter-value> = 'temp'

  • <getMethod> = get

Using addRawParams method

The example GET request shown at the top of this page can be replicated using the library's addRawParams method, like this:

const filterParameters = {
  label__startswith: 'temp',
};
const tempDevices = await Ubidots.devices.addRawParams(filterParameters).get();

Here:

  • <entity> = devices

  • <queryObject> = filterParameters

  • <getMethod> = get

  • <queryParam1> = label__startswith

  • <value1> = 'temp'

Accessing the filters

  • contains

  • contained_by

  • has_key

In order to maintain the camel-case standard of JavaScript, the library's filters are written in camel-case, so the previous filters would look like this:

  • contains

  • containedBy

  • hasKey

Below you'll find the full list filters, as defined in the API vs. how they look in the library.

Filter in the API
Filter in the library

exact ( = )

exact

in

in

Filter in the API
Filter in the library

exact ( = )

is

isnull

isNull

Filter in the API
Filter in the library

exact

is

range

range

gt ( > )

greaterThan

gte (≥)

greaterThanEq

lt ( < )

lowerThan

lte (≤)

lowerThanEq

isnull

isNull

Filter in the API
Filter in the library

exact ( = ) (case sensitive)

exact

iexact (case sensitive)

iexact

contains

contains

icontains (case insensitive)

iContains

startswith

startsWith

istartswith (case insensitive)

iStartsWith

endswith

endsWith

iendswith (case insensitive)

iEndsWith

in (case sensitive)

in

isnull

isNull

Filter in the API
Filter in the library

exact ( = )

exact

contains

contains

contained_by

containedBy

overlap

overlap

len

len

isnull

isNull

Filter in the API
Filter in the library

contains

contains

contained_by

containedBy

has_key

hasKey

has_any_keys

hasAnyKeys

has_keys

hasKeys

isnull

isNull

Filter in the API
Filter in the library

exact ( = )

exact

date

date

year

year

quarter

quarter

month

month

week

week

day

day

hour

hour

minute

minute

second

second

isnull

isNull

Depends on the used.

Depends on the used.

are written in snake-case. Take a look at some of the supported for example:

⌨️
{
  queryParam1: value1 
  ···    
  queryParamN: valueN
}
field filters
API filters
object filters
ID
Boolean
Number
String
Array
Object
Date
<getMethod>
<getMethod>