Tech Rescue
  • Home
  • Acronyms
  • Cheat-Sheets
  • User Manuals
MongoDB

How to remove documents from a capped collection in MongoDB

Hector Perez

Mar 14, 2018

You can’t remove one or all documents from a capped collection in MongoDB. BUT! you can drop the collection!

Execute the following command:

db.getCollection('myCollection').drop()

The result for me is:

true

There you go, quick and easy.

Sources:

  • https://docs.mongodb.com/manual/core/capped-collections/
  • https://stackoverflow.com/questions/33048282/how-to-remove-a-document-from-the-capped-collection

Read next

Install Kong OSS DB-less mode in Ubuntu Mate Impish 21.10 in Raspberry PI 4

1. Pull docker images. sudo docker pull arm64v8/kong 2. Run Kong in DB-less mode. sudo docker run -d --name kong \ -e "KONG_DATABASE=off" \ -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \ -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \ -e "KONG_PROXY_ERROR_LOG=/dev/stderr" \ -e "KONG_ADMIN_ERROR_
Hector Perez Feb 28, 2022

Install DecK for Kong in Ubuntu 20.04 (focal)

1. Download the TAR file: curl -sL https://github.com/kong/deck/releases/download/v1.11.0/deck_1.11.0_linux_amd64.tar.gz -o deck.tar.gz 2. Extract the TAR file: tar -xf deck.tar.gz -C /tmp 3. Copy the files to the right place: sudo
Hector Perez Feb 28, 2022
IEEE-754

IEEE-754

Floating Point Made Simple! The IEEE-754 standard defines how computers represent floating point numbers — that is, numbers with decimals like 3.14 or -0.001. It helps ensure that all systems (computers, languages, CPUs) store and calculate with floating point numbers consistently. Why Do We Need IEEE-754? Computers use binary
Hector Perez Apr 10, 2025
Tech Rescue © 2025. Powered by Ghost