Categories
Database, Cloud, & IT Transfer

How to Rename DCA Wrangler Models in Petro.ai – Part 2

Last week, we discussed how to delete specific DCA Wrangler models. This week, we will look at how to rename them.

What if you accidentally hit save before naming the model correctly?  Or if your model evolves into something more than you first intended?

You can just follow these steps to update your model name.

Let’s get started!

You will need a couple of things:

1. Well Decline Curve or Type Curve models created with the DCA Wrangler

2. Robo 3T (free) or Studio 3T (easier use, not free).

3. Valid Petro.ai Database Connection.

Quick FYI – Petro.ai Collection (Tables)

prod.WellDeclineCurveModels – Decline Curve Models saved using Single-Well or Multi-Well mode

prod.TypeCurveModels – Type Curve Models saved using Type Curve mode

Robo 3T and Studio 3T

Code for Single-Well/Multi-Well (Robo 3T)

/*
This script will RENAME all well decline curve models listed below. 
Insert your current model name in currentName.
Insert your new model name in newName.
*/

var currentName = "Q1Modelss";
var newName = "Q1Model";

db.getCollection("prod.WellDeclineCurveModels").updateMany(
    { modelName: currentName },
    { $set: { modelName: newName } }
);

Code for Single-Well/Multi-Well (Studio 3T)

//Define Database Below
use petroai;
/*
This script will RENAME all well decline curve models listed below. 
Insert your current model name in currentName.
Insert your new model name in newName.
*/

var currentName = "Q1Modelss";
var newName = "Q1Model";

db.getCollection("prod.WellDeclineCurveModels").updateMany(
    { modelName: currentName },
    { $set: { modelName: newName } }
);

Examples:

Robo 3T

Studio 3T – IntelliShell

Code for Type Curves (Robo 3T) 

/*
This script will RENAME all type curve model listed below. 
Insert your current model name in currentName.
Insert your new model name in newName.
*/

var currentName = "Q1TypeCurvess";
var newName = "Q1TypeCurves";

db.getCollection("prod.TypeCurveModels").updateMany(
    { modelName: currentName },
    { $set: { modelName: newName } }
);

Code for Type Curves (Studio 3T)

//Define Database Below
use petroai;
/*
This script will RENAME all type curve model listed below. 
Insert your current model name in currentName.
Insert your new model name in newName.
*/

var currentName = "Q1TypeCurvess";
var newName = "Q1TypeCurves";

db.getCollection("prod.TypeCurveModels").updateMany(
    { modelName: currentName },
    { $set: { modelName: newName } }
);

Examples:

Robo 3T

Studio 3T – IntelliShell

DONE!

Categories
Database, Cloud, & IT Transfer

How to Delete DCA Wrangler Models in Petro.ai – Part 1

Have you ever wondered how you can remove DCA Wrangler models that are stored in the Petro.ai Database?

Dream no longer!

You will need a couple of things:

1. Well Decline Curve or Type Curve models created with the DCA Wrangler

2. Robo 3T (free) or Studio 3T (easier use, not free).

3. Valid Petro.ai Database Connection.

Quick FYI – Petro.ai Collections (Tables)

prod.WellDeclineCurveModels – Decline Curve Models saved using Single-Well or Multi-Well mode

prod.TypeCurveModels – Type Curve Models saved using Type Curve mode

Robo 3T and Studio 3T

Code for Single-Well/Multi-Well (Robo 3T)

/*
This script will DELETE all decline curve models listed below. 
Change "false" below to "true" in order to delete, otherwise it will just count (for safety)
*/

//List all model names, in quotes and separated by commas:
var modelNames = [
    'MyModel1',
    'MyModel2',
]
//////////////////////////////////////////////////////
var I_WOULD_LIKE_TO_DELETE_ALL_MODELS = false;
//////////////////////////////////////////////////////
modelNames.forEach((modelName) => {
    if (I_WOULD_LIKE_TO_DELETE_ALL_MODELS) {
        printjson({
            _id: modelName,
            modelCount: db.getCollection("prod.WellDeclineCurveModels").deleteMany({'modelName': modelName}),
        });
    }
    else {
        printjson({
            _id: modelName,
            modelCount: db.getCollection("prod.WellDeclineCurveModels").count({'modelName': modelName}),
        });
    }
});

Code for Single-Well/Multi-Well (Studio 3T)

//Define Database Below
use petroai;
/*
This script will DELETE all decline curve models listed below. 
Change "false" below to "true" in order to delete, otherwise it will just count (for safety)
*/
//List all model names, in quotes and separated by commas:
var modelNames = [
    'MyModel1',
    'MyModel2',
]
//////////////////////////////////////////////////////
var I_WOULD_LIKE_TO_DELETE_ALL_MODELS = false;
//////////////////////////////////////////////////////
modelNames.forEach((modelName) => {
    if (I_WOULD_LIKE_TO_DELETE_ALL_MODELS) {
        printjson({
            _id: modelName,
            modelCount: db.getCollection("prod.WellDeclineCurveModels").deleteMany({'modelName': modelName}),
        });
    }
    else {
        printjson({
            _id: modelName,
            modelCount: db.getCollection("prod.WellDeclineCurveModels").count({'modelName': modelName}),
        });
    }
});

Examples:

Robo 3T

Studio 3T – IntelliShell

Code for Type Curves (Robo 3T) 

/*
This script will DELETE all type curve models listed below. 
Change "false" below to "true" in order to delete, otherwise it will just count (for safety)
*/
//List all model names, in quotes and separated by commas:
var modelNames = [
    'MyModel1',
    'MyModel2',
]
//////////////////////////////////////////////////////
var I_WOULD_LIKE_TO_DELETE_ALL_MODELS = false;
//////////////////////////////////////////////////////
modelNames.forEach((modelName) => {
    if (I_WOULD_LIKE_TO_DELETE_ALL_MODELS) {
        printjson({
            _id: modelName,
            modelCount: db.getCollection("prod.TypeCurveModels").deleteMany({'modelName': modelName}),
        });
    }
    else {
        printjson({
            _id: modelName,
            modelCount: db.getCollection("prod.TypeCurveModels").count({'modelName': modelName}),
        });
    }
});

Code for Type Curves (Studio 3T)

//Define DB Below
use petroai;
/*
This script will DELETE all type curve models listed below. 
Change "false" below to "true" in order to delete, otherwise it will just count (for safety)
*/
//List all model names, in quotes and separated by commas:
var modelNames = [
    'MyModel1',
    'MyModel2',
]
//////////////////////////////////////////////////////
var I_WOULD_LIKE_TO_DELETE_ALL_MODELS = false;
//////////////////////////////////////////////////////
modelNames.forEach((modelName) => {
    if (I_WOULD_LIKE_TO_DELETE_ALL_MODELS) {
        printjson({
            _id: modelName,
            modelCount: db.getCollection("prod.TypeCurveModels").deleteMany({'modelName': modelName}),
        });
    }
    else {
        printjson({
            _id: modelName,
            modelCount: db.getCollection("prod.TypeCurveModels").count({'modelName': modelName}),
        });
    }
});

Examples:

Robo 3T

 

Studio 3T – IntelliShell

Enjoy!

Stay tuned for the next blog where I will talk about how to rename your model.