Mongodb query failed - field getMore must be of type long

Hi,

Do i know the reason of this error while collection query db.banks.find()

“Field ‘getMore’ must be of type long in: { getMore: 121154538034027.0, collection: “Banks”, batchSize: 1000, lsid: { id: UUID(“6dc081c0-f200-4306-ab2c-43570dff0ff3”) }, $db: “SV-DB” }”

Hi @khasim_ali1! Which tool are you using to run this command, and which version of that tool? What exactly are you entering?

Thanks Anna, Appreciated your quick reply.

We are using mongoose npm module from node.js application, we are using below query. Also it’s not occurring always only few times.

await banksModel.find();

Mongoose version - 5.9.7
Mongodb enterprise - 4.4.6

mongoose 5.9.7 depends on a fairly old version of the Node.js driver, namely 3.5.5. It seems like changes that have fixed this problem (in particular, https://github.com/mongodb/node-mongodb-native/commit/7d1f54751ce0ae4331afb36dc3fe7b7c92be10f2) have been made in the Node.js driver since.

Based on that, I feel confident saying that upgrading mongoose to a more recent version (latest 5.x or 6.x) should address this issue.

1 Like

Thank you so much Anna, Will try migrating to new version and let you know if we face any further issues

Hello Anna,

We have migrated the mongoose library but still issue is exist,
Mongoose:- 6.4.3
MongoDB driver:- 4.7.0
MongoDB enterprise:- 4.4.0

@khasim_ali1 Are you getting the exact same issue with those versions? Do you have a code snippet that reproduces these? Either way, if this is still happening with the 4.7.0 driver, I’d recommend opening a JIRA bug report about this: https://jira.mongodb.org/projects/NODE/issues

Yes Anna, It’s still coming for the same normal query

await banksModel.find();

It’s coming sometimes, not able to reproduce always.

How can we resolve this issue?

Hello Anna,

Can you please let me know how to resolve this issue?

@khasim_ali1 Did you open a ticket in https://jira.mongodb.org/projects/NODE/issues as suggested above? If so, can you link to it?