Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document.list() returns 500 error when filtering by instanceId #1270

Open
shotainoguchi opened this issue Feb 7, 2025 · 0 comments
Open

Comments

@shotainoguchi
Copy link

Describe the bug
When calling document.list() and specifying instanceId as a filter, a 500 error is returned.

To Reproduce
Execute the following code:

client.documents.list({
  filter: {
    equals: {
      property: ["instanceId"],
      value: {
        externalId: "377471e4-c9cf-4a3b-9e35-49981c8b576a",
      },
    },
  },
  limit: 1000,
});

You will see an 500 error Internal server error. Please contact Cognite.

Expected behavior
I was able to get a valid response with this request:

client.post(
  `/api/v1/projects/${PROJECT}/documents/list`,
  {
    data: {
      filter: {
        equals: {
          property: ["instanceId"],
          value: {
            space: "File_Search",
            externalId: "377471e4-c9cf-4a3b-9e35-49981c8b576a",
          },
        },
      },
      limit: 1000,
    },
  }
);

In my humble opinion, we should modify the Label interface for example:

export type CogniteExternalId = string;
export type CogniteSpace = string;
export interface Label {
  externalId: CogniteExternalId;
  space: CogniteSpace;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant