2 — BadValue

queryconfiguration

A command argument or query operator has an invalid value

What is happening?

BadValue indicates that a parameter, option, or field value passed to a MongoDB command or query is invalid. This can happen with malformed query filters, invalid aggregation expressions, unsupported option combinations, or type mismatches in command arguments.

Common causes

  1. Invalid type passed to a query operator (e.g. $gt with a non-comparable type)
  2. Malformed aggregation pipeline stage
  3. Unsupported or deprecated option passed to a command
  4. Invalid regular expression syntax
  5. Incorrect field path expression in aggregation

Source code references

ErrorCodes::BadValue found in 697 locations in the MongoDB server source.

Diagnostic Steps

Related Issues