I executed:
mongoimport -d chessCyberWar -c DataNode test.json
and ended up with this statement:
connected to: localhost
imported 1 document
When I check the collection, it is still empty though.
My collection DataNode has this scheme:
Name: { type: String, required: true, unique: true },
Lat: Number,
Lng: Number,
X: Number,
Y: Number,
Type: Number,
PvP: { type: Boolean, default: false },
Owners: [{ type: mongoose.Schema.Types.ObjectId, ref: "Player" }]
And the test.json file has this content:
{
"Name": "Dew Drop Inn",
"Lat": 51.5264588,
"Lng": -0.8146601,
"X": 65239,
"Y": 43573,
"Type": 28,
"PvP": false,
"Owners": [ ]
}
How come it says the document has been imported, but when I search for it, there is nothing there?
P.S. for searching I used this:
db.DataNode.find({ Type: { $ne: -1 }}...