I am new to mongodb, nodejs and mongooseJS. Recently, I am trying to create a mongoose scheme for my JSON.
{
"endpoints":["a","z"],
"poi":[{
"location_name": "a",
"latitude": " 10.1075702",
"longitude": "76.345662",
"distance" : "0.0"
}, {
"location_name": "b",
"latitude": "10.110199",
"longitude": "76.3489361",
"distance" : "2.0"
}, {
"location_name": "c",
"latitude": "10.1197471",
"longitude": "76.342873",
"distance" : "3.1"
}, {
"location_name": "d",
"latitude": "10.1254479",
"longitude": "76.3332626",
"distance" : "4.4"
}, {
"location_name": "e",
"latitude": "10.1443277",
"longitude": "76.2566017",
"distance" : "13.9"
}, {
"location_name": "f",
"latitude": "10.1487145",
"longitude": "76.2441114",
"distance" : "15"
}, {
"location_name": "z",
"latitude": "10.145578",
"longitude": "76.2317077",
"distance" : "16.9"
}]
}
This is my JSON file that I have. I tried using generate-schema from https://github.com/nijikokun/generate-schema which gave me the following output
{
endpoints:[ 'String' ],
poi: [ 'String' ]
}
I used this, and when I tested it using Postman from the chrome web store, I was not able to get the full JSON from the database using the get request. I also could not successfully complete the mail request.
I recently tried using a JSON scheme instead of a mongoose scheme using
mongoose.Schema("JSON Schema')
When I try to use a JSON scheme, I can get data from mongodb collections using a GET request, but I cannot send POST data correctly using a JSON scheme
, nodejs - java mongodb. - Java mongodb, -?