0

I have around 7 million document in oplog.$main in which 5 million of them are empty with no object like "o" : { }

I want to get rid of them to free up space, but not able to remove them. Any help is appreciated.

db.oplog.$main.findOne()

{ "ts" : Timestamp(1443109104, 1), "op" : "n", "ns" : "", "o" : { } }

db.oplog.$main.count({ "ts" : Timestamp(1443109104, 1)})

1

db.oplog.$main.remove({ "ts" : Timestamp(1443109104, 1)})

WriteResult({ "writeError" : { "code" : 2, "errmsg" : "invalid collection name" } })

Aseem Jain
  • 333
  • 2
  • 7
  • I'm not sure if you can manipulate oplog direclty. – Saleem Mar 17 '16 at 23:19
  • maybe some useful infor could be found in this question http://stackoverflow.com/questions/15444920/modify-and-replay-mongodb-oplog? – zangw Mar 18 '16 at 01:25
  • @Saleem you are right, I cannot even insert record in oplog.> db.oplog.$main.insert({"data":"inserted"}) WriteResult({ "writeError" : { "code" : 2, "errmsg" : "invalid collection name" } }) – Aseem Jain Mar 18 '16 at 16:40
  • See @zangw posted up in comments. It may help you. – Saleem Mar 18 '16 at 16:55

0 Answers0