TylerBrock / mongo-hacker

MongoDB Shell Enhancements for Hackers
tylerbrock.github.io/mongo-hacker
MIT License
1.79k stars 235 forks source link

profile command failing on .find() operation #195

Closed Chinney closed 5 years ago

Chinney commented 6 years ago

I am currently getting this error message whenever I use the find() command:

Error: profile command failed: {
  "_t": "OKMongoResponse",
  "ok": 0,
  "code": 115,
  "errmsg": "Command is not supported",
  "$err": "Command is not supported"
}

However everything still will be outputted. The message appears like 1 second after the shell has listed all results. I am not sure how to debug this. It does not appear on other operations like findOne() or if I concatenate with the count() command.

stennie commented 5 years ago

The original error message is from CosmosDB, which does not fully implement the MongoDB API.

Mongo Hacker uses the profile command to determine the current slowms value for comparison with the last query execution. I've changed this to assume the default (100ms) if the profile command is not supported (or authorised).