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

Mongodb filter will be empty when is invalid map #3139

Open
zhongwencool opened this issue Dec 25, 2024 · 0 comments
Open

Mongodb filter will be empty when is invalid map #3139

zhongwencool opened this issue Dec 25, 2024 · 0 comments

Comments

@zhongwencool
Copy link
Contributor

image

Expect

Do not update with an empty object '{}', as this will leave users unaware of what went wrong. Instead, provide feedback indicating the incorrect format, or just let backend validate this format.

Incorrect Format:

atom
{
      $or: [
      { username: "${username}" },
      { clientid: "${clientid}" },
      { ipaddress: "${peerhost}" }
    ]
    }

Note: The correct format should be:

{
      "$or": [
      { username: "${username}" },
      { clientid: "${clientid}" },
      { ipaddress: "${peerhost}" }
    ]
}
  • Providing an empty object {} can lead to confusion and does not give any indication of what might be wrong.
  • Instead, return a message or log an error indicating that the input format is incorrect, helping users understand and correct their mistakes.
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