mongoimport choosing field type

后端 未结 4 1112
臣服心动
臣服心动 2020-12-17 18:21

When importing data from file (csv in my case) mongoimport automatically choose data type for each field.

Is it possible to choose data type manually for specific fi

4条回答
  •  无人及你
    2020-12-17 18:50

    See the Type Fidelity section in the documentation:

    mongoimport and mongoexport do not reliably preserve all rich BSON data types because JSON can only represent a subset of the types supported by BSON. As a result, data exported or imported with these tools may lose some measure of fidelity. See MongoDB Extended JSON for more information.

    Use mongodump and mongorestore to preserve types.

提交回复
热议问题