[COMPASS-7144] String field incorrectly autodetected as RegEx on CSV import Created: 24/Aug/23  Updated: 29/Oct/23  Resolved: 21/Sep/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: 1.40.0

Type: Bug Priority: Minor - P4
Reporter: Chris Grabosky Assignee: Le Roux Bodenstein
Resolution: Fixed Votes: 0
Labels: needs-prioritization
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Windows 11 Pro Build 22621.2134
Compass: 1.37.0-beta.2


Story Points: 3
Documentation Changes: Not Needed

 Description   

Problem Statement/Rationale

When importing a CSV which has a column where some are normal strings and others are URL slugs, for example "/Home/Example" the column gets detected as "mixed" type on import and fails with the error below as it is treated as a regular expression. 

If manually changing to String, it imports successfully.

Please be sure to attach relevant logs with any sensitive data redacted.

{"name":"BSONError","message":"The regular expression option [T] is not supported [Col 5][Row 15]"} {"name":"BSONError","message":"The regular expression option [A] is not supported [Col 5][Row 26]"} {"name":"BSONError","message":"The regular expression option [N] is not supported [Col 5][Row 28]"} {"name":"BSONError","message":"The regular expression option [S] is not supported [Col 5][Row 31]"} {"name":"BSONError","message":"The regular expression option [V] is not supported [Col 5][Row 66]"} {"name":"BSONError","message":"The regular expression option [D] is not supported [Col 5][Row 85]"} {"name":"BSONError","message":"The regular expression option [W] is not supported [Col 5][Row 86]"} {"name":"BSONError","message":"The regular expression option [C] is not supported [Col 5][Row 99]"} {"name":"BSONError","message":"The regular expression option [E] is not supported [Col 5][Row 100]"}

Steps to Reproduce

  • Create a CSV
  • Have a column contain text only
  • in a row for that column, put values like "/Home" and "/Home/Example"
  • Import the CSV in compass to an empty collection
  • Notice that the field type is autodetected to mixed
  • Run the import
  • Notice the error that it is treated as a regular expression

Expected Results

It autodetects as string and imports successfully

Actual Results

It autodetects incorrectly and throws import errors

 



 Comments   
Comment by Githook User [ 03/Oct/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix: don't automatically select regex when detecting regex COMPASS-7144 (#4886)

don't automatically select regex when detecting regex
Branch: export-to-language-v6
https://github.com/mongodb-js/compass/commit/e3ab55df3d9c7526ace255b80a850c980360f624

Comment by Githook User [ 25/Sep/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix: don't automatically select regex when detecting regex COMPASS-7144 (#4886)

don't automatically select regex when detecting regex
Branch: ga-releases
https://github.com/mongodb-js/compass/commit/e3ab55df3d9c7526ace255b80a850c980360f624

Comment by Githook User [ 22/Sep/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix: don't automatically select regex when detecting regex COMPASS-7144 (#4886)

don't automatically select regex when detecting regex
Branch: COMPASS-7238-enable-search-indexes-feature
https://github.com/mongodb-js/compass/commit/e3ab55df3d9c7526ace255b80a850c980360f624

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix: don't automatically select regex when detecting regex COMPASS-7144 (#4886)

don't automatically select regex when detecting regex
Branch: feature/COMPASS-7173
https://github.com/mongodb-js/compass/commit/e3ab55df3d9c7526ace255b80a850c980360f624

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix: don't automatically select regex when detecting regex COMPASS-7144 (#4886)

don't automatically select regex when detecting regex
Branch: beta-releases
https://github.com/mongodb-js/compass/commit/e3ab55df3d9c7526ace255b80a850c980360f624

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix: don't automatically select regex when detecting regex COMPASS-7144 (#4886)

don't automatically select regex when detecting regex
Branch: main
https://github.com/mongodb-js/compass/commit/e3ab55df3d9c7526ace255b80a850c980360f624

Generated at Wed Feb 07 22:45:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.