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

mongoimport should prohibit dotted field names

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: mongoimport
    • None

      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.

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

              Created:
              Updated:
              Resolved: