Skip to content

Commit

Permalink
Add quick-and-dirty way to wipe tags
Browse files Browse the repository at this point in the history
  • Loading branch information
RickdeJager committed Sep 8, 2022
1 parent 5708436 commit ef27554
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions wipe_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import re

from bson import ObjectId
from pymongo import MongoClient
from pymongo.errors import ServerSelectionTimeoutError
import sys
import pprint

mongo_server = "localhost:27017"

client = MongoClient(mongo_server, serverSelectionTimeoutMS=200, unicode_decode_error_handler='ignore')
db = client.pcap
pcap_coll = db.pcap

pcap_coll.update_many(
{ },
{ "$pull": { "tags": { "$nin": [ "flag-in", "flag-out" ] }} }
)

0 comments on commit ef27554

Please sign in to comment.