You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I setup everything, including a migrate.json file and created the migration using:
migrate create dark-theme-apply
/* eslint-disable no-param-reassign */importSettingfrom'../src/server/models/Setting';/** * Make any changes you need to make to the database here */asyncfunctionup(){// Write migration hereawaitnewPromise((resolve,reject)=>{try{constsettingsToChange=Setting.find({darkTheme: {$exists: false}});settingsToChange.forEach((setting)=>{setting.darkTheme=false;setting.save();});resolve();}catch(err){reject(err);}});}/** * Make any changes that UNDO the up function side effects here (if possible) */asyncfunctiondown(){// Write migration here}exportdefault{ up, down };
On running the following command
migrate up dark-theme-apply
I get the following error:
(node:10208) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
Synchronizing database with file system migrations...
Unexpected identifier
EDIT: Apparently, the error goes away when I dont use import but then when I use require it still doesnt work
The text was updated successfully, but these errors were encountered:
Hi! It sounds like you normally use Babel or something to build your js.
The file you used to import, but now require in your migration file, could you please verify that that file does not contain imports / export default directly or indirectly in nested requires?
Hi,
So I setup everything, including a
migrate.json
file and created the migration using:On running the following command
I get the following error:
EDIT: Apparently, the error goes away when I dont use
import
but then when I userequire
it still doesnt workThe text was updated successfully, but these errors were encountered: