• Using NodeBB or Mongo's CLI, what would be the best way to delete all user signatures?

  • NodeBB

    After backing up your database you can run the following.

    db.objects.update({_key: {$regex: /^user:\d+$/}}, {$set: {"signature": ''}}); This will match all user documents and set the signature field to empty string.

  • @baris Thank you. I'm pretty new to Mongo and after a little tinkering I figured out I had to run the following to get it work correctly:

    db.objects.update({_key: {$regex: /^user:\d+$/}}, {$set: {"signature": ""}}, {multi: true});

Suggested Topics

  • 3
  • 1
  • 1
  • 1
  • 5
| |