Skip to content

Can limit be used inside of Include when using the backend API? #413

Answered by ericingram
coderreco asked this question in Help
Discussion options

You must be logged in to vote

You can use a URL like “/carts/:last” to have it return a single record as the result

The “:last” segment refers to the latest record depending on how the collection is sorted, and by default it’s sorted by date, hence it refers to the latest cart

Alternatively you can add “limit: 1” to the data object, it then it would return a paginated result, so I imagine you would prefer the former approach

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@coderreco
Comment options

Answer selected by coderreco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants