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
2
votes
1 answer

track deleted documents in Mongo DB's capped collection

Is there any options which allow to track document when it goes to be deleted from capped collection? For example, I have a list of orders with the status - handled or not. So I want to persist that orders in in capped collection and check status…
silent_coder
  • 6,222
  • 14
  • 47
  • 91
1
vote
1 answer

sorting capped mongodb collection in spring boot

I am trying to sort capped collection in descending order. what I have tried: @Tailable @Query(sort = "{$natural:-1}") Flux findAllByConversationId(String conversationId); it gives: Query failed with error code 2 and error…
1
vote
1 answer

Mongo Tailable Cursor { Error: No More Documents in Tailed Cursor }

When I try to run my code it shows "MongoError: No More Documents in Tailed Cursor". const mongoose = require('mongoose'); const Schema = require('mongoose').Schema; const dataSchema = new Schema({ id: String, name: Number, timestamp:…
1
vote
0 answers

mongodb capped collections consume from offset

We are considering using MongoDB capped collections as our fifo queues. Our requirements are the following: Processing of the messages should be done in insertion order No messages should be lost/skipped We should be able to start consuming from a…
1
vote
1 answer

Pub/Sub MongoDB Capped collection

If i try to update capped collection it returns "Capped collections can't be updated". What I came to know is capped collections can't be updated. I'm newbie, and for my project requirements I have to notify client about any data updates at server…
UserAT152
  • 15
  • 5
1
vote
1 answer

MongoDB capped collection performance

I am recently working on a time series data project to store some sensor data.To achieve maximum insertion/write throughput i used capped collection(As per the mongodb documentation capped collection will increase the read/write performance). when i…
1
vote
2 answers

Capped collections vs Queues

I'm trying to understand what is the capped collection is, specifically in context of MongoDB, and what would be the difference in compare with queue?
dmi3y
  • 3,482
  • 2
  • 21
  • 32
1
vote
1 answer

Capped collections and _id auto index

What is the rationale for having auto index on _id field for capped collections by default? We can find in the docs that: Without this indexing overhead, capped collections can support higher insertion throughput. There was a post about capped…
wombatonfire
  • 4,585
  • 28
  • 36
1
vote
0 answers

mongodb capped collections with TTL

I have an application that allows users to chat with other users, I only want to store X messages per each conversation, AND each message must be deleted after 1 month since its creation (TTL) MongoDB support capped collections with TTL? The…
fj123x
  • 6,904
  • 12
  • 46
  • 58
1
vote
1 answer

Mongoid Capped Collection

I'm trying to create a capped collection with Mongoid. I have a definition as follows: class Customer include Mongoid::Document store_in(collection: 'customers') field: n, type: String, as: :name field: a, type: String, as: :address …
fowlball1010
  • 343
  • 3
  • 13
1
vote
1 answer

Read and Write Simultaneosuly from Different mongodb capped collections in same database

I have a database with multiple small-sized capped collections (about 1MByte each) that I am using in tailable cursor mode. Is it possible to read and write simultaneosuly from different mongodb capped collections in this database (i.e. tail (and…
VarsMolta
  • 432
  • 2
  • 5
  • 13
1
vote
0 answers

"Capped collections" in Cassandra

Cassandra doesn't have capped collections (or row size limits), but one way of simulating it is to use an offline mapreduce job clean up extra entries. Would it be better to have a second table that stores row counts for primary keys in another…
David Ehrmann
  • 7,366
  • 2
  • 31
  • 40
1
vote
2 answers

MongoDB get size of Capped collection

Is it possible to get max size of capped collection in MongoDB, the same size you have specified during creation?
Michał Jurczuk
  • 3,728
  • 4
  • 32
  • 56
1
vote
0 answers

Using mongodb gridfs with capped collections

I'm using mongodb gridfs for a kind of file cache where I store binary data including some metadata. Cause my disk space is limited I cannot store all my files in the mongodb, so I'd like to apply a FIFO algorithm. I've found the capped collections…
1
vote
1 answer

What size is capped in mongodb capped collection?

When specifying the 'size' parameter for a capped collection, which of the following sizes from db.collection.stats() is capped to that size? is it "size", "storageSize", "storageSize"+"totalIndexSize" or some other option? Thanks!
achiash
  • 1,692
  • 2
  • 12
  • 14