I am creating a database in mongodb
. I have this sample JSON format
{
first_name: "John",
last_name: "Doe",
memberships: ["mem1", "mem2"],
address: {
street: "4 main st",
city: "Boston"
},
contacts: [
{
name: "Brad",
relationship: "friend"
}
]
}
I have created a database and collection "user". I want to define a schema of this collection as like above JSON.
I am using mongodb compass tool https://www.mongodb.com/products/compass to create database, collection, schema, managing etc, I am applying this JSON in input box which is left of apply button, so on clicking on apply button it does not create a schema.
Does anyone know what is the way to create a schema of collection using this tool ?
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments