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

Unable to use "between" for multiple sort keys #13951

Closed
3 tasks done
lwang-79 opened this issue Oct 24, 2024 · 4 comments
Closed
3 tasks done

Unable to use "between" for multiple sort keys #13951

lwang-79 opened this issue Oct 24, 2024 · 4 comments
Assignees
Labels
Gen 2 Issues related to Gen 2 Amplify projects GraphQL Related to GraphQL API issues question General question

Comments

@lwang-79
Copy link

Before opening, please confirm:

JavaScript Framework

Next.js

Amplify APIs

GraphQL API

Amplify Version

v6

Amplify Categories

api

Backend

Amplify Gen 2

Environment information

# Put output below this line
  System:
    OS: macOS 15.0.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 71.03 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.9.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.8.3 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 130.0.6723.59
    Safari: 18.0.1
  npmGlobalPackages:
    @aws-amplify/cli: 11.0.3
    @types/node: 18.7.4
    @ziglang/cli: 0.0.12
    aws-cdk: 2.131.0
    npm-check-updates: 17.1.2
    npm: 10.8.3
    nx: 19.8.3
    ts-node: 10.9.1
    typescript: 4.8.4
    yarn: 1.22.19

Describe the bug

I have a model "Job" wich has a GSI with 3 sort keys "datetime", "status", "type". When I try to query the data between tow datetime, I can't find a way to write the code. The "between" operator only accepts one itme in the array.

image
image

Expected behavior

The "between" operator can accept tow items.

Reproduction steps

  1. create a model with GSI similar to "index('instructorId').sortKeys(['datetime', 'status', 'type'])"
  2. try to query the data between tow datetime.

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending a response from the Amplify team. labels Oct 24, 2024
@cwomack cwomack added the GraphQL Related to GraphQL API issues label Oct 24, 2024
@chrisbonifacio chrisbonifacio self-assigned this Oct 24, 2024
@chrisbonifacio
Copy link
Member

Hi @lwang-79 can you please provide more information about the project's environment, such as the package.json file and dependencies listed in it?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Oct 24, 2024
@chrisbonifacio chrisbonifacio added Gen 2 Issues related to Gen 2 Amplify projects pending-maintainer-response Issue is pending a response from the Amplify team. labels Oct 24, 2024
@lwang-79
Copy link
Author

Hi @chrisbonifacio, thank you for checking this. Here is my package.json

{
  "name": "next-driving",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@aws-amplify/geo": "^3.0.52",
    "@chakra-ui/icons": "^2.1.1",
    "@chakra-ui/next-js": "^2.2.0",
    "@chakra-ui/react": "^2.8.2",
    "@emotion/react": "^11.13.3",
    "@emotion/styled": "^11.13.0",
    "aws-amplify": "^6.6.2",
    "framer-motion": "^11.5.6",
    "next": "^14.2.14",
    "react": "^18",
    "react-dom": "^18",
    "react-slick": "^0.30.2",
    "react-webcam": "^7.2.0"
  },
  "devDependencies": {
    "@aws-amplify/backend": "^1.3.0",
    "@aws-amplify/backend-cli": "^1.2.8",
    "@types/node": "^22",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "@types/react-slick": "^0.23.13",
    "aws-cdk": "^2.159.1",
    "aws-cdk-lib": "^2.159.1",
    "constructs": "^10.3.0",
    "esbuild": "^0.23.1",
    "tsx": "^4.19.1",
    "typescript": "^5.6.2"
  }
}

@chrisbonifacio
Copy link
Member

it looks like you are a bit behind on the package versions.

can you upgrade to the latest versions of @aws-amplify/backend and @aws-amplify/backend-cli?

also, after upgrading, please run the following command and confirm that the version output is 1.10.2.

npm list @aws-amplify/data-schema

if not, run the following command to update the package and re-run the above command to confirm.

npm update @aws-amplify/data-schema

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Oct 28, 2024
@chrisbonifacio chrisbonifacio added pending-community-response Issue is pending a response from the author or community. question General question and removed pending-triage Issue is pending triage labels Oct 28, 2024
@chrisbonifacio
Copy link
Member

Hi 👋 Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with any information previously requested by our team members so we can re-open this issue and be better able to assist you.

Thank you!

@chrisbonifacio chrisbonifacio closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
@github-actions github-actions bot removed the pending-community-response Issue is pending a response from the author or community. label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gen 2 Issues related to Gen 2 Amplify projects GraphQL Related to GraphQL API issues question General question
Projects
None yet
Development

No branches or pull requests

3 participants