课程: Advanced MongoDB: Efficient and Secure Data Management

今天就学习课程吧!

今天就开通帐号,24,100 门业界名师课程任您挑!

Time series collections

Time series collections

- [Instructor] A time series collection is a collection that is optimized for time series data. You can store any data in it that changes over time and has at least one unchanging parameter. An example of an unchanging parameter would be a stock's ticker. Let me show you an example. Here is an example document that contains stock information. It's got three different fields. The first one is a field called ts, which has a timestamp, the second one is called ticker, which has the metadata that doesn't change. So all prices that come in for MongoDB are always going to have the ticker name Mongo MDB. And then it's got a third piece of information, which is the price. All right, so with that in hand, we can create the time series collection. Now, if you're used to creating collections, you'll know that you can create them by simply inserting a document. But to create a time series collection, you have to use the…

内容