Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Compass
Created by Guest
Created on Mar 3, 2020

Display/use escaped characters like "\n" for line break in document editor

I have text fields that may contain "invisible" special characters like a line-break, which is commonly represented as "\n". Another example might be "\t" for tab, but there may also be other invisible unicode characters. I would like to be able to edit/save documents in MongoDB Compass that contain such characters. The current behaviour is that these characters are completely lost when the document is in edit mode and saved (updated). Manually inserting "\n" in a text field does not insert a line break, but literally a backslash + "n". Example document: { "_id": "***", "text": "Hello,\n\nThis is my message." } If I edit this document, e.g. changing the "." at the end of the text to a "!" it would be saved as "Hello,This is my message!"
  • Attach files
  • Guest
    Mar 5, 2020
    In Compass 1.20+ you can do this by switching to JSON Mode (see attachment).