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

Admin Panel: exists filter does not work for number fields #8181

Closed
sorra opened this issue Sep 12, 2024 · 2 comments · Fixed by #8415
Closed

Admin Panel: exists filter does not work for number fields #8181

sorra opened this issue Sep 12, 2024 · 2 comments · Fixed by #8415
Assignees
Labels

Comments

@sorra
Copy link

sorra commented Sep 12, 2024

Link to reproduction

No response

Describe the Bug

There is a number field named numeric:

  • if its value is undefined, either exists: true or exists: false returns it.
undefined-with-true undefined-with-false
  • if its value is a number, either exists: true or exists: false not returns it.
number-with-true number-with-false

Note: the related MongoDB queries seemed correct.

To Reproduce

  1. Create a project using npx create-payload-app@latest, select blank project and mongodb adapter
  2. Add a collection using the following code snippet:
import { CollectionConfig } from 'payload/types'

const Buyers: CollectionConfig = {
  slug: 'buyers',
  admin: {
    useAsTitle: 'id',
  },
  fields: [
    {
        name: 'id',
        type: 'text',
        required: true,
        index: true,
        unique: true,
    },
    {
        name: 'numeric',
        type: 'number',
        required: false,
    }
  ],
}

export default Buyers
  1. Create a buyer in admin panel and filter by exists on the number field

Payload Version

2.28

Adapters and Plugins

db-mongodb

@sorra sorra added status: needs-triage Possible bug which hasn't been reproduced yet v2 labels Sep 12, 2024
@PatrikKozak PatrikKozak self-assigned this Sep 25, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Sep 25, 2024
Copy link

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2024
Copy link

github-actions bot commented Oct 2, 2024

🚀 This is included in version v2.30.1

@github-actions github-actions bot unlocked this conversation Oct 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants