Help me fix bug, Mongo related

Hello, anyone here that could assist me with bug i have.

I really tried and tried, but no luck, I will try to explain my problem.

Back in 2015, me and my buddy went crazy for Meteor framework, so much that we learned it and started one game that would work on crypto.

Its simple raffle/lottery game, and fun to play within community.

Now after so many years, as now have our own crypto, i remembered about the code we had on git.

i did had to run “meteor update” to be able to start app and access it to web, all works perfectly, but one method bugs the game.

and logs points to findAndModify method causing bug when wallet notify .sh script about first confirmation. must add that wallet notify works and i can see deposits, but when it want to update detail in users address, it creates this bug.

from what i can see its problem with mongo collection, where we are using

// Insert in Mongo if it doesn't exist
var oldTransaction = Transactions.findAndModify({
var oldTransaction = Transactions.findOneAndUpdate({
    query: {
        transactionId: transactionId

Must note that i tried mongo4, mongo5, mongo6 but no luck, as i cannot find mongo3 as its not supported any more, and again all points to mongo method problem removed on newer versions.

This is error i get from logs

TypeError: Cannot read property 'apply' of undefined
at packages/meteor.js:343:21
at ns.Collection.Mongo.Collection.findAndModify (packages/fongandrew_find-and-modify.js:74:14)
at notify (server/lib/notifyPayment.js:36:39)
at notifyPayment (server/lib/notifyPayment.js:92:12)

I think this is the last update on findAndModify. Simply put, client side it probably doesn’t work and server side you can do it with the rawCollection or some substitutes that you might find in the conversation. However the package you are using fongandrew_find-and-modify hasn’t been touched in something like 8 years.

This might also help a bit: Meteor Mongo does not have findAndModify support - how to generate atomic counters?

1 Like