Questions tagged [capped-collections]

A fixed size collection of elements sorted by insertion order

A capped collection is a fixed size collection of elements sorted by insertion order. Once the capped size has been reached, the collection behaves like a circular queue, overwriting the oldest elements with any new elements.

47 questions
1
vote
0 answers

MongoDB, How do I change non-capped collection status?

Now, I use capped collection in MongoDB, I want to revert non-capped collection. How can I? What have to change? (But, I don't want to delete data in collection)
1
vote
2 answers

Monitoring usage of capped collections

I'm using MongoDB's awesome capped collections + tailable cursors for message-passing between the different processes in my system. I have many such collections, for the different types of messages, to which documents are written at variable rates…
shx2
  • 61,779
  • 13
  • 130
  • 153
0
votes
0 answers

Can I prevent disk filling up by changing a Mongodb collection from TTL to Capped?

I have a MongoDB 4.4 server (single node, no replicas) for storing IoT-style data. Data is written to several collections every few seconds by my NodeJS app. Documents are not updated/modified, and reads are less common than writes. I have TTL…
John
  • 6,701
  • 3
  • 34
  • 56
0
votes
1 answer

Spring WebFlux + MongoDB: Tailable Cursor and Aggregation

I´m new with WebFlux and MongoDB. I´m trying to use aggregation in a capped collection with tailable cursor, but I´m nothing getting sucessful. I´d like to execute this mongoDB query: db.structures.aggregate( [ { $match: { …
0
votes
1 answer

use replica to store capped collection in mongodb

Is it possible to create a capped collection in a read only mode at a single replica in MongoDB? There is a main database with replica set and I need to use a capped collection with a AWS queue to listen for new insertions. In order to avoid…
doomsk
  • 31
  • 5
0
votes
1 answer

MongoDB tailable cursor timeout

I'm looking into using mongodb for a pub-sub model. I went through different articles like http://tugdualgrall.blogspot.fr/2015/01/how-to-create-pubsub-application-with.html and…
user320550
  • 1,093
  • 6
  • 20
  • 37
0
votes
1 answer

Specify `max` Without `size` when Creating MongoDB Capped Collection

When trying to create a MongoDB capped collection with only a limit for the max number of documents and not a size limit (not sure how large will all the documents be), pymongo is giving the error pymongo.errors.OperationFailure: specify size:
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
0
votes
0 answers

Converting or copying uncapped collection to capped

My use-case supports capped collections. So, trying to convert or copy existing uncapped collection to capped collection. Conversion/Copy are successful. But the problem is there are no enough records as original contain. Uncapped…
srikanth
  • 958
  • 16
  • 37
0
votes
1 answer

Set limits on mongo db collection

So, there are two limits I want to set in mondo db: 1. Only allow one document to be inserted into the dbs, and no more. This document cannot be deleted once added, BUT it can be modified. Also, no other documents can be added to that…
deeveeABC
  • 960
  • 3
  • 12
  • 34
0
votes
1 answer

Add a field into capped collection in MongoDB

I created a capped collection to store my log data with few fields. Due to some requirement I wanted to add an additional field named "createAt" in this collection. db.myLogs.update({},{$set: {"createAt":new Date()}}) This is throwing below…
Vipul
  • 1,563
  • 4
  • 22
  • 46
0
votes
1 answer

How to use 64-bit long auto-increment counters in MongoDB

I'm implementing a logger database using MongoDB. The capped collection will contain log messages collected from several sources across the network. Since I want to do $lte/$gte queries on _id afterwards I need to have an _id that grows as a…
conceptacid
  • 248
  • 2
  • 13
0
votes
1 answer

Play + ReactiveMongo: capped collection and tailable cursor

I'm using Play Framework with Scala, Akka and ReactiveMongo. I want to use a collection in MongoDB as a circular queue. Several actors can insert documents into it; one actor retrieves these documents as soon as they're available (a sort of…
0
votes
0 answers

Social Activity Feed - Best Approach for Per-User Capped Collections in MongoDB?

I am working on a social activity feed system very similar to the 10Gen Socialite Project which has been running in production for a couple of years now. I have a new use case wherein I need to store a chronologically ordered list of activities per…
Matt
  • 1
  • 1
0
votes
1 answer

MongoDB 2.2 emptying capped collection error

I have a problem removing records from a capped collection. DB is complaining that command doesn't exists. There is a collection that is capped. I have verified by issuing isCapped(). I switch to a db that contains the collection. Then I run…
Irfan Mulic
  • 1,186
  • 3
  • 14
  • 28
0
votes
1 answer

Size of MongoDB capped collection is not right?

I have a capped collection. When I call stats() on it I get following output: /* 0 */ { "ns" : "log_db.access_logs", "count" : 42088, "size" : 13602632, "avgObjSize" : 323, "storageSize" : 100003840, "numExtents" : 1, …
VaidAbhishek
  • 5,895
  • 7
  • 43
  • 59