Whenever I try to save a place in my mongodb, it is not displayed, so I think I'm doing something wrong. I can not find the documentation on how to save the location in the mongoose, so I will just ask it here.
First I create my model:
var eventSchema = mongoose.Schema({
name : String,
creator : String,
location : { type: [Number], index: '2dsphere'},
});
Then I try to add it to my database:
var newevent = new event({
name: name,
creator: tokenUser,
location : { type: "Point", coordinates: [longitude, latitude] },
});
When I look in my database, everything is stored except for the location ...
source
share