Skip to content

Wix Data Aggregate .limit() Not Working as Expected #537

@hahaha-helpme

Description

@hahaha-helpme

The .limit(10) function in Wix Data’s aggregate() does not correctly restrict the number of returned results. Despite setting a limit of 10, the query still returns 16 results.

Steps to Reproduce:

  1. Execute the following Wix Data aggregate query:
const aggregatedKeys = await wixData
  .aggregate("gcp-tables/research_2_processed_product_data")
  .group("product_id_hostname")
  .filter(wixData.filter().isEmpty("processed_product_data_aggregated"))
  .limit(10)
  .run()
  .then(agg => agg.items.map(item => item.product_id_hostname));

console.log("result", aggregatedKeys);
  1. Observe the output in the console. Instead of 10 results, it returns 16.

Expected Behavior:

The .limit(10) function should ensure that a maximum of 10 results are returned.

Actual Behavior:

The limit is ignored, and more than 10 results are retrieved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions