Creating a time series through the wire listener
You can create time series with the REST API or the MongoDB API through the wire listener. You create time series objects by adding definitions to time series collections.
Before you begin
You must understand time series concepts, the properties of your data, and how much storage space your data requires. For an overview of time series concepts and guidance on how to design your time series solution, see Informix® TimeSeries solution.
Perform the following prerequisite tasks:
- Connect to a database in which to create the time series table. You run all methods in the database.
- Configure the wire listener for the MongoDB API or the REST API. For more information, see Configuring the wire listener for the first time.
- Configure storage spaces for your time series data.
Procedure
To create a time series through the wire listener:
-
Choose a predefined calendar from the
system.timeseries.calendar
collection or create a calendar by adding a document to thesystem.timeseries.calendar
collection. -
Create a TimeSeries row type by adding a document to the
system.timeseries.rowType
collection.The row type must include one BSON column for the JSON data. -
Create a container by adding a document to the
system.timeseries.container
collection. - Create a time series table with the time series table format syntax.
- Instantiate the time series by creating a virtual table with the time series virtual table format syntax.
-
Load time series data.
You can use the REST API or the MongoDB API to load time series data through a virtual table. You can use the MQTT protocol to load time series data into the time series base table.
What to do next
After you create and load a time series, you query the data though the virtual table with MongoDB and REST clients.