Skip to content

[BUG] Pagination bug: submodel-refs endpoint returns same results with cursor when using MongoDB backend #860

@mm-hsh

Description

@mm-hsh

Describe the bug
Pagination is not working correctly in the GET /shells/{aasIdentifier}/submodel-refs endpoint when using MongoDB as the backend. Even when using limit and cursor query parameters, the same data is returned repeatedly. However, this issue does not occur when using the in-memory database.

To Reproduce
Steps to reproduce the behavior:

  1. Steps to reproduce the behavior:
  2. Set up the AAS environment with MongoDB as the backend.
  3. Call GET /shells/{aasIdentifier}/submodel-refs?limit=1
  4. Use the returned cursor in the next request.
  5. Observe that the same data is returned again, instead of the next page.

Expected behavior

  • The endpoint should return the next set of submodel-refs based on the cursor and limit.
  • Pagination should behave consistently across different backends.

BaSyx :

  • Aas-env image version: aas-environment:2.0.0-SNAPSHOT
  • aas-registry image version: aas-registry-log-mongodb:2.0.0-SNAPSHOT
  • sm-registry image version: submodel-registry-log-mongodb:2.0.0-SNAPSHOT

Screenshots
endpoint: http://localhost:8081/shells/{aasIdentifier}/submodel-refs?limit=1

Image

endpoint: http://localhost:8081/shells/{aasIdentifier}/submodel-refs?limit=1&cursor={valueFromPreviousResponse}

Image

Used Asset Administration files (.aasx/.json/.xml)

Example.aas.xml

BaSyx configuration

basyx-setup-issue.zip

Additional context

  • Pagination works correctly with the in-memory database.
  • The issue seems specific to MongoDB backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions