Skip to content

Conversation

@NoOne7135
Copy link
Contributor

… Double type

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances data type handling in the MongoConnector by adding support for BSON Double type for floating-point numbers and improving type conversion logic. The changes ensure proper storage and retrieval of numeric values in MongoDB.

Key Changes

  • Added BSON Double type import and usage for FLOAT type fields
  • Enhanced setFieldValue method with better validation and type handling for INTEGER, FLOAT, DATE, DATETIME, BOOLEAN, and DECIMAL types
  • Updated type detection priority to handle DECIMAL before other numeric types
  • Fixed getMinMaxValues to correctly access column.name property
  • Improved createRecordOriginalValues and updateRecordOriginalValues to properly apply type conversions using setFieldValue

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NoOne7135 NoOne7135 requested a review from ivictbor January 2, 2026 13:51

if (field.type === AdminForthDataTypes.INTEGER) {
if (value === "" || value === null) return null;
const n = typeof value === "number" ? value : Number(String(value).replace(",", "."));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NoOne7135 lets remove replace


if (field.type === AdminForthDataTypes.FLOAT) {
if (value === "" || value === null) return null;
const n = typeof value === "number" ? value : Number(String(value).replace(",", "."));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NoOne7135 lets throw new error with clear message, even if typeof is not number at all '1.0' -> or '1' -> ok, 'afsa' -> throw

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and do it on top level in common databaseConnector

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

newRecord[colName] = record[colName];
for (const [key, raw] of Object.entries(record)) {
const col = colsByName.get(key);
newRecord[key] = col ? this.setFieldValue(col, raw) : raw;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be there because exists in main adapter

Image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NoOne7135 NoOne7135 merged commit 18d2854 into next Jan 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants