1

I'm trying to insert multiple documents using MongoVUE by passing an array of documents in the Insert Document window. For example:

 [ {"name": "Kiran", age: 20}, {"name": "John", "age": 31} ]    

However, I kept getting the following error:

ReadStartDocument can only be called when CurrentBsonType is Document, not when CurrentBsonType is Array    

Does anyone know how to do bulk insert in MongoVUE?

Thanks!

krisze
  • 13
  • 4

1 Answers1

8

In case anyone else stumbles on this question, the answer is that the "Import Multiple Documents" functionality in MongoVue doesn't accept an array of objects like you would expect it to. Instead, it expects the document to be formatted as a simple series of documents.

For the above example, you could create a simple file called "import.json" and format the data like this and it will import fine:

{"name": "Kiran", age: 20}
{"name": "John", "age": 31}
VPel
  • 413
  • 5
  • 12
  • 1
    Note that current MongoVUE import and export formats aren't consistent. If you export and then reimport, for example when restoring manually backed up data, replace "}," with "}" – Chip McCormick May 02 '14 at 14:23
  • I can't find the insert "multiple documents", only one document. Using Version 1.6.6.0 – jtromans Jun 13 '14 at 13:13
  • 2
    As a follow-up to what @ChipMcCormick said, you can tweak the export options so that they are consistent with MongoVUE's import format: change the default **Lines Terminated By** setting from `,\r\n` to just `\r\n`. The exported document will then be formatted properly for reimport. (No clue why this isn't default in MongoVUE.) – Nate Barbettini Mar 23 '15 at 17:31