# Data Typing Limitations In MongoDB
When using MongoDB actions, you may encounter unexpected behavior when it comes to typing inserted data. In this guide, we'll explain what's happening and provide you with some workarounds.
# Applicable Actions
This guide applies to the following actions:
# Integers Inserted As Doubles
If using a JSON sample to generate a schema for insertion into a collection, you may notice
integer values are translated to
number types. When data is inserted into MongoDB, the
number type will be transformed into a
The root cause is that JSON doesn't distinguish integers from floating point numbers. For example:
1 is equivalent to
To ensure fields are loaded as
integers, manually add the field using the Add new field option in the schema editor.
# Decimals Inserted As Doubles
The default behavior for MongoDB is to type decimal values like
If you want data to be typed as
Decimal128, you'll need to modify the field in MongoDB after it's been inserted.
Last updated: 1/11/2022, 5:21:18 PM