Hey @Yogesh_Sonawane1,
Thank you for reaching out to the MongoDB Community forums.
In MongoDB, the time-series collection follows a bucketing pattern to store the data in an optimized format. So, when you create a time-series collection, it creates 3 collections within the same database out of which 2 are internal collections:
- db.system.views collection which contains information about each view in the database
- db.system.buckets.<collection_name> which contains the data in an optimized and compressed format for efficient storage of the time series data.
For example, in your case, you have created a time-series collection. The collection acts as a view that allows you to interact with all the documents and perform operations.
Regarding your question about the readability of the data using Binary(Buffer.from) , the actual data is stored in a bucketing pattern within the db.system.buckets.<collection_name> collection. This means that the individual documents are merged together into a single document known as a “bucket” based on timestamp and metafield.
It’s worth noting that the time series collection was primarily designed to capture a stream of data and aggregate those data, where the aggregation result is typically the end result of the workflow, instead of looking at individual data points. Hence, the current implementation of system.bucket is one way to achieve this goal, and we should expect that the underlying storage pattern will change for the better over time. Therefore, I don’t think you can depend on the current pattern being what it is today. In the future, the system.bucket collection may not exist or may not resemble what it is today. To ensure that your workflow still works with future time series implementations, I encourage you not to depend on its current structure.
Hope it answers your questions, in case you have any further questions or concerns feel free to reach out.
Best regards,
Kushagra