Use
mongoimport --jsonArray --db test --collection docs --file example2.json
Its probably messing up because of the newline characters.
More Related Contents:
- MongoDB: Combine data from multiple collections into one..how?
- MongoDB: Is it possible to make a case-insensitive query?
- MongoDB: count the number of items in an array
- How to remove a field completely from a MongoDB document?
- Multiple join conditions using the $lookup operator
- Aggregate $lookup Total size of documents in matching pipeline exceeds maximum document size
- Understanding MongoDB BSON Document size limit
- MongoDB – admin user not authorized
- How can I run MongoDB as a Windows service?
- Mongo complex sorting?
- MongoDB: update every document on one field
- How to sum every fields in a sub document of MongoDB?
- Where does mongodb stand in the CAP theorem?
- MongoDb shuts down with Code 100 [closed]
- Mongodb Query To select records having a given key
- MongoDB: how to parse date in 3.6 mongoDb version?
- MongoDB – is DBREF necessary?
- saving picture to mongodb
- MongoDB – Querying between a time range of hours
- Delete a key from a MongoDB document using Mongoose
- Is shortening MongoDB property names worthwhile?
- Simple HTTP/TCP health check for MongoDB
- Mongoose.js instance.save() callback not firing
- Save Subset of MongoDB Collection to Another Collection
- Meteor method vs. deny/allow rules
- MongoDB Update Deep Array
- Is there a convention to name collection in MongoDB?
- Map-Reduce performance in MongoDb 2.2, 2.4, and 2.6
- MongoDB count() versus countDocuments()
- Mongo $in operator performance