125 — CommandFailed
queryconfiguration
The command cannot be executed against a view
What is happening?
CommandNotSupportedOnView is returned when a command that only works on regular collections is run against a view. Views are read-only stored aggregation pipelines. Write operations (insert, update, delete), index operations (createIndex, dropIndex), and certain administrative commands (compact, validate) are not supported on views.
Common causes
- Attempting to insert, update, or delete documents on a view
- Trying to create or drop an index on a view
- Running compact, validate, or reIndex against a view
- Application code not distinguishing between collections and views