dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
865 stars 467 forks source link

Support limit and offset in our CA queries #30453

Open freddyDOTCMS opened 3 weeks ago

freddyDOTCMS commented 3 weeks ago

Parent Issue

No response

Problem Statement

Cube.js already support limit and offset but we need to support them in our syntax, the way as it works for Cube.js is:


{
  "measures": ["Orders.count"],
  "dimensions": ["Orders.status"],
  "limit": 10,   // Limit the results to 10 rows
  "offset": 20   // Skip the first 20 rows
}

Steps to Reproduce

URL:  '/api/v1/analytics/content/_query' 
Method: POST
body: {
    "query": {
        "dimensions":["request.url"],
        "order": "request.url desc"
    }
}

Must response just with the second register returned in the first query

NOTE TO QA:

You can also refer to my comment showcasing how the limit and offset parameters work and can be added to the queries.

Acceptance Criteria

Limit and offset must works as expected

dotCMS Version

latest in master

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

jcastro-dotcms commented 6 days ago

The limit and offset parameters in both the dotCMS query and the official CubeJS query work as expected. Here's how you can test them:

josemejias11 commented 19 hours ago

Approved: Tested on master_b295876_SNAPSHOT, Docker, macOS 14.5, FF v126.0.1