Skip to content

Mongodb filter will be empty when is invalid map #3139

@zhongwencool

Description

@zhongwencool
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions