Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-1736

mongoimport should prohibit dotted field names

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mongoimport
    • Labels:
      None

      Description

      A user recently told me he acquired some JSON data and imported it into MongoDB with mongoimport, even though it included dots in some field names. The JSON data was not intended for import into MongoDB, so it didn't conform to our Restrictions on Field Names.

      He was then puzzled when he tried to import the data using a driver (Mongolite, which is built on libmongoc and libbson), and got a server error, "Error: document to insert contains invalid keys".

      I'm surprised mongoimport doesn't get that error, actually, since I thought the error came from the server and I don't know how mongoimport bypasses the server's fieldname validation. But however it does so, it shouldn't. mongoimport should prevent invalid field names by default and only allow them if the user asks.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              david.golden David Golden
              Reporter:
              jesse A. Jesse Jiryu Davis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: