Querying records with logical filters

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsQuerying records with logical filters
Line 1: Line 1:
### Lesson
+
### Tutorial
  
Learn how to query a SQL or NoSQL database by appending filter strings into a REST API call.
+
Query a SQL or NoSQL database by appending filter strings into a REST API call.
  
 
### Supported SQL Databases
 
### Supported SQL Databases
Line 21: Line 21:
 
* Azure Tables
 
* Azure Tables
  
### Example 1 - Query contact records with a last name that starts with the letter 'Y'
+
### Example - Fetch contact records whose last name starts with 'Y'
  
 
* Table name: contact
 
* Table name: contact
 
* Filter parameter in API call: last_name like Y%
 
* Filter parameter in API call: last_name like Y%
* API call: http://your-url/api/v2/db/_table/contact?filter=last_name%20like%20Y%25
+
* Request URL: https://your-url/api/v2/db/_table/contact?filter=last_name%20like%20Y%25
 +
 
 +
### Example - Query contact records whose last name is 'Yang'
 +
 
 +
* Table name: contact
 +
* Filter parameter in API call: last_name = Yang
 +
* Request URL: https://your-url/api/v2/db/_table/contact?filter=last_name%20%3D%20Yang
 +
 
 +
### Example - Query contact records whose first name is 'Jon' and last name is 'Yang'
 +
 
 +
* Table name: contact
 +
* Filter parameter in API call: first_name = Jon and last_name = Yang
 +
* Request URL: https://your-url/api/v2/db/_table/contact?filter=first_name%20%3D%20Jon%20and%20last_name%20%3D%20Yang

Revision as of 22:33, 16 September 2015

      1. Tutorial

Query a SQL or NoSQL database by appending filter strings into a REST API call.

      1. Supported SQL Databases
  • PostgreSQL
  • MySQL
  • SQLite
  • SQLite 2
  • MS SQL Server
  • Sybase
  • Oracle
  • IBM DB2
      1. Supported NoSQL Databases
  • MongoDB
  • CouchDB
  • DynamoDB
  • Azure Tables
      1. Example - Fetch contact records whose last name starts with 'Y'
      1. Example - Query contact records whose last name is 'Yang'
      1. Example - Query contact records whose first name is 'Jon' and last name is 'Yang'