Models that are routed using the resources (as described in webserver) method on the routing table can automatically be queried and the response adjusted by using a set of query parameters.

Given a model

class Customer < Banking::Model

    export_methods :balance,  :credit_score
    scope :is_richer_than, ->{ | other_code | where("balance > ?", Customer.find_by_code(other_code).balance) }
          export: true
    has_many :addresses

    def balance
        return some_sort_of_calculation
    def credit_score
        return another_sort_of_calculation

Can be queried by using a slightly contrived request like so:

customers = new Banking.Models.Customer.where( { tag:'special', name: { op: 'like', value: 'Fred%' } }
    include: ['balance','credit_score']
    order: { name: 'DESC' }
    limit: 2
    start: 3

Will perform a SQL query something like:

select <field_list ommited> from banking_customers
left join blanking_addresses on
where tag='special' and name like 'Fred%' order by name desc limit 2 offset 3

And then return a JSON reply

    success: true, total: <total number of customer records>,
    data: [
           code: 'FRED', name: "Fredric", tag: "special", addresses: [
               { line1: "1234 Blvd St", zip: 12345 }
               { line1: "9876 Roue St", zip: 93733 }
           code: 'FRY', name: "Freddy", tag: "special", addresses: [
               { line1: "87 Ave South", zip: 82344 }

When the query is sent to the server the operations use short codes to limit the length of the query param

It assigns the following meaning the these parameters.