Reputation: 173
I'm using compass community v1.13.1 and have been trying to populate some sample data for couple of hours, but failed.
Found a similar issue here, I followed the first answer by @ktsangop but it didn't work.
Cant paste as a json object anyway, if I set type to string, it will be just blank string; if set type to object, can't paste the json string as a whole.
Do I need to insert a valid json object one field by one field? or am I doing it wrong?
Upvotes: 14
Views: 10756
Reputation: 17850
For future visitors: this answer might help.
Just switch the view to JSON (the two curlies button - a feature that was added after this question was raised it seems like), hit "Edit Document" upon hovering a document, and then you will be editing the JSON directly which gives you a lot of flexibility and speed.
Upvotes: 3
Reputation: 3
For inserting a new document manually in MongoDB compass by following steps:
Upvotes: 0
Reputation: 6914
Can't believe that this is an actual issue.. for the first 2 minutes I though that something is wrong with me lol
Anyhow, I do have a (hacky) solution:
Edit Document
button"
TADA!
UPDATE:
Seems like the copy-paste action will only take effect if the json is partial (valid jsons are ignored for some reason).. so I ended-up with an easier solution:
Edit Document
button{ "a": true }
copy only { "a": true
)}
)Upvotes: 5