• MongoDB

    MongoDB Change the data type of a field

    Problem: I want to change the data type of a field in my MongoDB collection from string to Date. Example: I have a field in my collection called expiry which has values stored in string like 31 Dec 2021 . I need to change this to a Date object. Solution: db.posts.find({}).forEach(function (doc) { db.posts.updateOne( { _id: doc._id, }, { $set: { expiry: new Date(doc.expiry) }, } ) }) The above shell command will find all collections in my posts collection and change the data in expiry field which is of type string to Date

  • General

    WordPress malware ch.trainresistor.cc

    Issue: WordPress site is not loading properly. Styles are not loading in the page. All requested are redirecting to an external URL ch.trainresistor.cc Cause: This is due to a vulnerabilty in a the wordpress plugin – “PublishPress Capabilities – User Role Access, Editor Permissions, Admin” More info on this here Resolution: This malware affects files and database. Search for trainresistor in your PHP files contents. Replace it with your site URL. Open the database using phpMyAdmin from your server control panel. Select your site database and then select wp_options table. Update the fields siteurl and admin_email to your website url and admin email. See below image After this open your…