🖥️
SIM-REST
  • Overview
  • Getting Started
  • Authentication
  • Routes
    • Methods
    • Protected Routes
  • Database
    • DB Query
  • Filter data
  • Helper
  • Session
Powered by GitBook
On this page
  • Sort
  • Limit
  • Only
  • Query examples

Was this helpful?

Filter data

Note: These below filter parameters only work with DB::where("collection-name")->all() function.

Sort

Sort by DESC is default

You can sort by ASC from url as below

example.com/posts?sort=ASC

Limit

Limit by 0 index is default

You can limit collection from url as below

example.com/posts?limit=4

Only

only can retrieve the data with specific keys.

example.com/posts?only=title,author,category

Query examples

example.com/posts?limit=2
example.com/posts?sort=DESC
example.com/posts?limit=4&sort=ASC&only=title
example.com/posts?limit=10&sort=DESC&only=username,email

PreviousDB QueryNextHelper

Last updated 4 years ago

Was this helpful?