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

Unsupported OP_QUERY command: aggregate. The client driver may require an upgrade. MongoDB 6.0.1 #133

Open
shebistar opened this issue Oct 5, 2022 · 5 comments

Comments

@shebistar
Copy link

Using MongoDB 6.0.1 Community and the following query:

db.XXXXXX.aggregate([
{
"$match": {
"status": "done"
}
}, {
"$group": {
"_id": null,
"done": {
"$count": {}
}
}
}
])

It returns the following error:

response:Object
message:"Unsupported OP_QUERY command: aggregate. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal"

But with MongoDB 5.0 it works fine.

@simplylizz
Copy link

You can update package.json and set driver to the latest version (e.g. "mongodb": "^4.12.1"). Worked for me.

@ChinmoyPadhi
Copy link

You can update package.json and set driver to the latest version (e.g. "mongodb": "^4.12.1"). Worked for me.

@simplylizz I tried the same with "mongodb": "^6.0.1", but Jenkins is complaining No matching version found for mongodb@^6.0.1. whereas it worked with 4.12.1

Could you please help with right version, which I can use , I'm looking for version 6 and version 5

@simplylizz
Copy link

@ChinmoyPadhi I think you're confusing driver (i.e. node package) version & mongodb server version.

@denef
Copy link

denef commented Mar 19, 2023

You can update package.json and set driver to the latest version (e.g. "mongodb": "^4.12.1"). Worked for me.

When I do that the server fails to run. Seems a mix of NPM versions. Any ideas? https://stackoverflow.com/questions/68692038/how-to-solve-error-syntaxerror-unexpected-token

grafana-storage/plugins/mongodb-grafana-master/node_modules/mongodb/lib/operations/add_user.js:16
        this.options = options ?? {};
                                ^

SyntaxError: Unexpected token ?

--- updated node, that fixed it

@We-unite
Copy link

Have you got it solved? I'm facing with the same question now, but my mongodb version is 7.0.12

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

5 participants