Views

Introduction

A view is a subset of a collection. The item model for a view is a subset of the item model of the base collection. Optionally, a filter can be added to the view to limit the contained items to only items matching the filter.

Views share namespace with regular collections, and the endpoints for views use the following URL format:

https://<host-name>/<api-path>/<view-name>

View properties

You can include all, or a limited set of properties in the model for the view.

Developer portal - view properties

View filter

Use a filter to limit the items contained within the view to only items that match the filter.

Use the filter builder to create a filter for the view.

You can create a filter that limits the matching items to items not in stock by using a filter like itemsInStock eq 0.

Developer portal - view filter



Items in the original collection:

[
          {
              "sku": "A",
              "description": "Wigdet A",
              "price" : 12,
              "itemsInStock": 5
          },
          {
              "sku": "B",
              "description": "Wigdet B",
              "price" : 17,
              "itemsInStock": 0
          },
          {
              "sku": "C",
              "description": "Wigdet C",
              "price" : 18.9,
              "itemsInStock": 12
          }
          ,
          {
              "sku": "D",
              "description": "Wigdet ¤",
              "price" : 14.7,
              "itemsInStock": 0
          }
      ]



Items in the filtered view:

[
          {
              "sku": "B",
              "description": "Wigdet B",
              "price": 17
          },
          {
              "sku": "D",
              "description": "Wigdet ¤",
              "price": 14.7
          }
      ]

View access