8000 mongoose 6.5 not work · Issue #10 · WelingtonMonteiro/mongoose-history-trace · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mongoose 6.5 not work #10

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

Open
hmz22 opened this issue Sep 3, 2022 · 5 comments
Open

mongoose 6.5 not work #10

hmz22 opened this issue Sep 3, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@hmz22
Copy link
hmz22 commented Sep 3, 2022

in mongoose v6.5 show this error DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
please update mongoose 6 or new
and when use findByIdAndUpdate in graphql show this error:

Error: \n    at model.Query._wrappedThunk [as _findOne] (D:\\Projects\\Tests\\node-ts-sample-decorator2\\node_modules\\mongoose\\lib\\helpers\\query\\wrapThunk.js:25:28)\n    at D:\\Projects\\Tests\\node-ts-sample-decorator2\\node_modules\\kareem\\index.js:426:25\n    at processTicksAndRejections (internal/process/task_queues.js:77:11)",
          "stacktrace": [
            "MongooseError: Query was already executed: Member.findOne({",
            "  _id: new ObjectId(\"6312eddb7ef718e09f7089...",
            "    at model.Query._wrappedThunk [as _findOneAndUpdate] (D:\\Projects\\Tests\\node-ts-sample-decorator2\\node_modules\\mongoose\\lib\\helpers\\query\\wrapThunk.js:21:19)",
            "    at D:\\Projects\\Tests\\node-ts-sample-decorator2\\node_modules\\kareem\\index.js:334:18",
            "    at _next (D:\\Projects\\Tests\\node-ts-sample-decorator2\\node_modules\\kareem\\index.js:128:16)",
            "    at D:\\Projects\\Tests\\node-ts-sample-decorator2\\node_modules\\kareem\\index.js:91:37",
            "    at processTicksAndRejections (internal/process/task_queues.js:95:5)
@WelingtonMonteiro WelingtonMonteiro self-assigned this Nov 3, 2022
@WelingtonMonteiro WelingtonMonteiro added the bug Something isn't working label Nov 3, 2022
@marcbernalencora
Copy link
marcbernalencora commented Dec 30, 2022

Experimenting same issue. Do you have any news on that?

const result = await MyModel.findByIdAndUpdate({...})

Mongoose version 6.8.0.

MongooseError: Query was already executed: certifications.findOne({ _id: new ObjectId("63ae2eeca15db2cb...
at model.Query._wrappedThunk [as _findOneAndUpdate] (/home/marcbernal/ld-reporting-tool/node_modules/mongoose/lib/helpers/query/wrapThunk.js:23:19)
at /home/marcbernal/ld-reporting-tool/node_modules/kareem/index.js:384:18
at _next (/home/marcbernal/ld-reporting-tool/node_modules/kareem/index.js:139:16)
at /home/marcbernal/ld-reporting-tool/node_modules/kareem/index.js:102:37
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
originalStack: 'Error\n' +
' at model.Query._wrappedThunk [as _findOne] (/home/marcbernal/ld-reporting-tool/node_modules/mongoose/lib/helpers/query/wrapThunk.js:27:28)\n' +
' at /home/marcbernal/ld-reporting-tool/node_modules/kareem/index.js:384:18\n' +
' at /home/marcbernal/ld-reporting-tool/node_modules/kareem/index.js:110:15\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:77:11)'

@WelingtonMonteiro
Copy link
Owner

Problem already fixed, during this first week of 2023 I will release a new version, this version will be a breaking point, I removed some problematic features.

@marcbernalencora
Copy link

That's great! Looking forward to it. Thanks and have a happy new year!!

@mspapant
Copy link

Hello @WelingtonMonteiro when are you going to release the new version? Thanks!!

@WelingtonMonteiro
Copy link
Owner

I still haven't released it because when testing it in the mongoose version, it triggered many errors, and the most serious one I saw was exactly the one mentioned, looking at the doc I saw that now multiple queries are no longer allowed in the same instance, therefore, this error is under analysis by the mongoose devs for release in plugins.
I'll be waiting for new features to fix.
Therefore, for now, the plugin only works in version < 6.

This weekend I will be releasing the new corrections.

https://mongoosejs.com/docs/migrating_to_6.html#duplicate-query-execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
0