I have a collection containing Reddit comments, gathered by a bot. The schema looks like this:
{
_id: ObjectId,
author: string,
body: string,
permalink: string,
created_utc: number,
upvotes: number,
downvotes: number
}
I would like to remove the upvotes
and downvotes
fields. I have tried using the following updateMany query:
use DBname
db.comments.updateMany({}, {$unset: {upvotes: "", downvotes: ""}})
Running this, I get the following error:
MongoServerError: Executing this update would put you over your space quota
This data base is located on MongoDB Atlas, in a free instance (limited at 512 MB). However I'm currently only using around 255 MB. I would expect this query to free up space, not to occupy more.
I should mention that these parameters do work with db.updateOne()
, however I would like to run the query using a single operation, rather than writing a script and calling multiple updateOne()
s.