IssueRaiser

Support for MongoDB time series collections

## Problem Prisma provides no way to define a time-series collection in MongoDB. Defining one with the raw nodeJS mongo client (or with mongoose) crashes Prisma when running commands such as `prisma db pull/push` ## Suggested solution Provide support for time series collections by allowing for syntax inside the schema.prisma file to indicate that a model is for a time series collection ## Alternatives None ## Additional context As far as I can see, there is no structural difference between a regular MongoDB collection and a time series collection in terms of how queries are run on it. A time series collection is just optimized under the hood to automatically use Mongo's [Bucketing Design Pattern](https://www.mongodb.com/blog/post/building-with-patterns-the-bucket-pattern). Differences do emerge when: - Creating a time series collection requires passing in an object with `timeField` and `metaField` keys specifying the fields to be used for the timestamp and meta data - Updating and deleting time series documents are either impossible (Mongo 5) or restricted (Mongo 5.3). See [here](https://www.mongodb.com/docs/manual/core/timeseries/timeseries-limitations/).

Posted by sapter on Jun 7, 2022, 12:20 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

support (Other)

Support for MongoDB time series collections

sapterJun 7, 2022, 12:20 PM

## Problem Prisma provides no way to define a time-series collection in MongoDB. Defining one with the raw nodeJS mongo client (or with mongoose) crashes Prisma when running commands such as `prisma db pull/push` ## Suggested solution Provide support for time series collections by allowing for syntax inside the schema.prisma file to indicate that a model is for a time series collection ## Alternatives None ## Additional context As far as I can see, there is no structural difference between a regular MongoDB collection and a time series collection in terms of how queries are run on it. A time series collection is just optimized under the hood to automatically use Mongo's [Bucketing Design Pattern](https://www.mongodb.com/blog/post/building-with-patterns-the-bucket-pattern). Differences do emerge when: - Creating a time series collection requires passing in an object with `timeField` and `metaField` keys specifying the fields to be used for the timestamp and meta data - Updating and deleting time series documents are either impossible (Mongo 5) or restricted (Mongo 5.3). See [here](https://www.mongodb.com/docs/manual/core/timeseries/timeseries-limitations/).

Comments (0)

No comments yet. Start the discussion.

Comment on this issue