-
Type: Task
-
Resolution: Duplicate
-
Priority: 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.
- duplicates
-
TOOLS-1335 mongoimport imports fields with dots (.) from JSON
- Closed