...
Info |
---|
CAST supports MongoDB via its NoSQL for .NET extension. As Amazon DocumentDB is MongoDB compatible, the support also applies to Amazon DocumentDB. Details about how this support is provided for .NET source code is discussed below. |
Supported Client Libraries
MongoDB Mongodb.Net Driver dotnet driver 2.x |
Supported Operations
Operation | Methods Supported |
---|
Insert |
|
|
| ||||||
Update |
|
| ||||||
Select |
|
FindAsync
FindOne
FindOneAs
Exists
FindOneAndDelete
FindOneAndDeleteAync
FindOneAndReplace
FindOneAndReplaceAsync
FindOneAndUpdate
FinOneAndUpdateAsync
FindAllAs
FindAll
FindOneByIdAs
BulkWrite
| ||||||
Delete |
|
|
Objects
Icon | Description | ||
---|---|---|---|
DotNet MongoDB database | |||
DotNet MongoDB collection | DotNet unknown MongoDB connection | ||
DotNet unknown MongoDB database | |||
DotNet unknown MongoDB collection |
...
Links are created for transaction and function point needs:
Link type | Source and destination of link | Methods supported |
---|
belongsTo |
From DotNet MongoDB |
Collection object |
to DotNet MongoDB Database object |
useInsertLink | Between the caller .NET Method (C#) object and DotNet MongoDB Collection object |
- GetDatabase
Between the caller .NET |
- CreateCollection
- CreateCollectionAsync
- GetCollection
Method (C#) object and DotNet unknown MongoDB Collection object | ||||||
| ||||||
useUpdateLink |
| |||||
useSelectLink |
|
Exists
|
FindAllAs
FindAll
FindOneByIdAs
| ||||||
useDeleteLink |
|
Amazon DocumentDB Identification
The below mentioned objects have properties to indicate whether the object is of type MongoDB or Amazon DocumentDB.
Object | Property Description | Type of Property Value | Possible Value(s) | Meaning |
---|---|---|---|---|
DotNet MongoDB collection | Is an Amazon DocumentDB collection? | Integer | 1 | The collection object is of type Amazon DocumentDB |
0 | The collection object is of type MongoDB | |||
DotNet unknown MongoDB collection | Is an Amazon DocumentDB collection? | Integer | 1 | The collection object is of type Amazon DocumentDB |
0 | The collection object is of type MongoDB |
What results can you expect?
Once the analysis/snapshot generation has completed, you can view the results in the normal manner (for example via CAST Enlighten). Some examples are shown below.
...
Database and Collection Creation
...
Expand | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
|
|
Insert Operation
Expand | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||
|
...
|
Delete Operation
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Select Operation
...
Expand | |||||
---|---|---|---|---|---|
| |||||
|
|
Update Operation
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Amazon DocumentDB Identification
...
Expand | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||
| Select |
|
|
Reading Database and Collection from Json File
Expand | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||
| Update
|
Violations in AED
Evolution
- Previously, only files consisting of relevant MongoDB imports were processed further for analysing.
- Support has been evolved to process a file when it does not contain MongoDB import but makes use of its methods (APIs). Assumption here is file makes use of same namespace as used in the file containing MongoDB imports.
Limitations
- Connection, database and collection names are resolved as known objects only in the following situations:
- Name is hardcoded
- Name is defined in the variable in the local method
- Name is defined in the config files
- Only files consisting of relevant MongoDB imports are processed further for analysing. In a case, where a file uses reference of another file / namespace which in turn uses relevant import, then file will not be analysed.
Future Development
...
|
Violations in CAST Engineering Dashboard
The CAST Engineering Dashboard recognises code violations in source applications.
Evolution
- Database and collection objects are resolved in maximum cases
- Support for all crud links for the library Mongodb.driver
- Reading database and collection values through JSON
Limitations
- Database and Collections are resolved in following situation:
- Anywhere in the .cs files and JSON files
- If Database and Collection values are not resolved, will create Unknown Database and Collection objects
- Setting of properties related to Amazon DocumentDB identification depends on proper resolution of connection string.