[DOCS-8094] mongoimport typed fields Created: 13/Jun/16  Updated: 17/Nov/16  Resolved: 17/Nov/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 3.4.0

Type: Task Priority: Major - P3
Reporter: Lucas Morales Assignee: Allison Reinheimer Moore
Resolution: Done Votes: 0
Labels: docs-3.4
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents TOOLS-67 Give mongoimport of CSV/TSVs a way to... Closed
Participants:
Days since reply: 7 years, 12 weeks, 6 days ago
Epic Link: 3.4 Tools Related Updates
Story Points: 2

 Description   

Re. TOOLS-67: mongoimport csv/tsv with specified types
For 3.4.0 release.

Most of the documentation that needs to be added will be regarding the last section in the following changeling (on the typed field input format):

overview of changes:

  • two new command line options:
    • 'columnsHaveTypes', boolean whether the field types are to be specified;
    • 'parseGrace', how to handle type coercion failures (one of skipField,
      skipRow, stop, autoCast). The skipRow option sends failed rows to
      standard output.
  • changed behavior:
    • if 'columnsHaveTypes' is set, then wherever column names are specified,
      the types will also be specified. If 'headerLine' is set, this refers
      to the first line of the input source. If 'fieldFile' is set, this
      refers to the file with the field names. If neither of these two
      options is set, this refers to the string given in the 'fields'
      option.
    • (behavior is unchanged if 'columnsHaveTypes' is not set)
  • new typed field input format (from wherever column names are specified):
    '<COLNAME>.<TYPE>(<ARG>)'
    • <TYPE> is one of: auto, binary, bool, date, date_go, date_ms,
      date_oracle, double, int32, int64, string. The 'date' type is an alias
      for 'date_go'.
    • <ARG> depends on the type. It can only be non-empty for the binary,
      date, date_go, date_ms, and date_oracle types.
      • Three characters, if used within the argument, must be
        backslash-escaped: '(', ')', and '\'.
      • For the 'binary' type, the argument is the encoding and must be one of
        base64, base32, or hex. The base64 and base32 variants correspond to
        the standard defined in RFC 4648.
      • For any of the 'date' types, the argument is a datetime layout string
        corresponding to the following:
        • 'date' aliases to 'date_go'
        • 'date_go' layouts correspond to the Golang time.Parse function
        • 'date_ms' layouts correspond to the Microsoft SQL Server FORMAT function
        • 'date_oracle' layouts correspond to the Oracle Database TO_DATE function
    • examples:
      • 'zipcode.string()'
      • 'followerCount.int32()'
      • 'user thumbnail.binary(base64)'
      • 'verified.boolean()'
      • 'misc.auto()'
      • 'created.date_ms(MM/dd/yyyy hh:mm:ss)'


 Comments   
Comment by Githook User [ 17/Nov/16 ]

Author:

{u'username': u'schmalliso', u'name': u'Allison Moore', u'email': u'allison.moore@10gen.com'}

Message: DOCS-8094: adds the --columnsHaveTypes and --parseGrace options
Branch: master
https://github.com/mongodb/docs/commit/e0ca7b425852e4f7d4f0b0f2aa3a8d9c9575cbe9

Comment by Lucas Morales [ 23/Jun/16 ]

This has been merged with the development branch of mongo-tools.

Generated at Thu Feb 08 07:55:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.