Corva Collections Overview
Introduction
This document will explain everything to know about Corva collections.
What is a collection
Corva uses Mongo databases for data storage.
A collection represents a catalog of data which is used by developers to select parts or groups of keys to create visualizations and perform calculations to achieve the scoped goal.
Users can also create new and unique collections to perform certain functions or calculations to a dataset.
As data is received from the source, Corva quality control systems correlate, clean, and match the data prior to it being stored in Mongo DB for app use.
This now allows the user to source enriched and QC’ed data for display in various apps via API calls.
All collections/datasets can be accessed through the user interface in Dev Center called Dataset explorer.
Types of collections
Time based- Record creation is based on a time interval (IE every 1 min)
- Example - Drilling data collected on a 1 sec interval
Depth based - Record creation is based on a depth interval (IE every 1 ft of depth)
- Example - Drilling data collected on a 1 ft drilling depth interval
Reference base - Record creation is based on a reference instance non depth or time related data (IE Handover-Notes)
How to use a collection
Apps interact with MongoDB collections through APIs using CRUD (Create - Read - Update - Delete) operations depending on what the application goal is.
Querying collections
Please refer to MongoDB documentation on how to query collections:
MongoDB Manual Getting Started
Querying collections
Collections example records and sample data to determine the correct keys needed and at what level those keys are in the collections schema. An example of a collections schema is shown below.
>
> "_id": "5f75f5016c880105025879a6",
> "data": {
> "activities": [
> {
> "day": 37935,
> "name": "In Slips",
> "night": 43200
> },
> {
> "day": 80,
> "name": "Run in Hole"
> },
> {
> "day": 455,
> "name": "Pull out of Hole"
> },
> {
> "day": 4725,
> "name": "Static Off Bottom"
> },
> {
> "day": 5,
> "name": "Dry Reaming Down"
> }
> ],
> "end_timestamp": 1545177600,
> "start_timestamp": 1545091200
> },
> "version": 1,
> "asset_id": 31659357,
> "provider": "corva",
> "timestamp": 1545177600,
> "collection": "activities.summary-2tours",
> "company_id": 1
Collection schema
When to use a collection
Use collections in app development in these cases:
Use a collection when the app requires data to be persisted in Corva
Use a collection when the user needs to query historical data via Corva Data API or Corva API in either a Front End or Back End application
Use a collection when the Front End app needs to subscribe to real-time data via Corva socketClient (custom web socket)
Use a collection when the Back End app needs to subscribe to real-time data via request library (Python) or asynchronous requests (Javascript)
Create a collection to merge several sets of data together from different existing collections
Create a collection in order to store calculated values for use in a Back End or Front End application
Use a collection if use case is to map Corva’s data with data from an external database
When not to use a collection
Collections should not be used in these cases:
Do not use a collection if an app does not require data to be persisted in Corva
Do not use a collection if app is posting data to Corva’s subscription endpoint