Home:ALL Converter>Create the structure of an empty collection in mongoDB

Create the structure of an empty collection in mongoDB

Ask Time:2014-02-26T00:17:55         Author:Edu

Json Formatter

Is there any possibility to create the structure of an empty collection in MongoDB using mongoimport from a JSON file like the one below?

"Users" : {
"name" : "string",
"telephone" : {
    "personal": { "type": "number" },
    "job": { "type" : "number" }
},
"loc" : "array",
"friends" : "object"
}

My goal is to create a mongoDB schema from JSON files.

Author:Edu,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22019976/create-the-structure-of-an-empty-collection-in-mongodb
yy