(Resolved) Error after update from 1.6 to 1.7 MongoError: '$set' is empty. You must specify a field like so: {$set: {<field>: ...}}

Updated to 1.7 (and accidentally also to 1.8), and after following the steps outlined here, this started happening. I’m not sure where this is going on or how to fix it, so I was hoping someone with experience might be able to see these error logs and help me pinpoint where I should be looking. I’ve looked through all of my code and nothing is ever set to undefined, so maybe it’s in a package of some sort?

W20190422-16:33:52.535(-3)? (STDERR) /Users/user_name/.meteor/packages/meteor-tool/.1.8.1.1k83ph4.d4ti++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:313
W20190422-16:33:52.535(-3)? (STDERR)                                            throw(ex);
W20190422-16:33:52.535(-3)? (STDERR)                                            ^
W20190422-16:33:52.536(-3)? (STDERR) 
W20190422-16:33:52.536(-3)? (STDERR) MongoError: '$set' is empty. You must specify a field like so: {$set: {<field>: ...}}
W20190422-16:33:52.536(-3)? (STDERR)     at Function.create (/Users/user_name/.meteor/packages/npm-mongo/.3.1.2.hanfom.kehlm++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/mongodb-core/lib/error.js:43:12)
W20190422-16:33:52.536(-3)? (STDERR)     at toError (/Users/user_name/.meteor/packages/npm-mongo/.3.1.2.hanfom.kehlm++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/mongodb/lib/utils.js:149:22)
W20190422-16:33:52.536(-3)? (STDERR)     at coll.s.topology.update (/Users/user_name/.meteor/packages/npm-mongo/.3.1.2.hanfom.kehlm++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/mongodb/lib/operations/collection_ops.js:1414:39)
W20190422-16:33:52.536(-3)? (STDERR)     at /Users/user_name/.meteor/packages/npm-mongo/.3.1.2.hanfom.kehlm++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/mongodb-core/lib/connection/pool.js:532:18
W20190422-16:33:52.537(-3)? (STDERR)     at _combinedTickCallback (internal/process/next_tick.js:132:7)
W20190422-16:33:52.537(-3)? (STDERR)     at process._tickDomainCallback (internal/process/next_tick.js:219:9)

Are you using the simple schema package?

aldeed:simple-schema? Yes.

I am assuming you also use the aldeed:collection2 package then? It automatically cleans what is being submitted to insert/update based on the schema. You might want to check out the options to write without cleaning

So apparently we have simple-schema installed, but it’s never used? Therefore I don’t know how that would be affecting this, unless you have some insight.

No insight. Maybe you need to look at the actual insert/update command. I believe there was some change a while a go where the mongo driver sanitizes queries, but can’t find a reference to it right now

Thanks for your help. I was able to track down the issue to some old legacy code that somehow was only now throwing an error. It was trying to find a certain value that no longer existed and setting that, essentially setting it to undefined. Thank you for your help!