{"action":"created","issue":{"url":"https://api.github.com/repos/nodeschool/austin/issues/9","labels_url":"https://api.github.com/repos/nodeschool/austin/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/nodeschool/austin/issues/9/comments","events_url":"https://api.github.com/repos/nodeschool/austin/issues/9/events","html_url":"https://github.com/nodeschool/austin/issues/9","id":98282336,"number":9,"title":"Mongoose and MongoDB write issue","user":{"login":"Kalevera","id":10354974,"avatar_url":"https://avatars.githubusercontent.com/u/10354974?v=3","gravatar_id":"","url":"https://api.github.com/users/Kalevera","html_url":"https://github.com/Kalevera","followers_url":"https://api.github.com/users/Kalevera/followers","following_url":"https://api.github.com/users/Kalevera/following{/other_user}","gists_url":"https://api.github.com/users/Kalevera/gists{/gist_id}","starred_url":"https://api.github.com/users/Kalevera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kalevera/subscriptions","organizations_url":"https://api.github.com/users/Kalevera/orgs","repos_url":"https://api.github.com/users/Kalevera/repos","events_url":"https://api.github.com/users/Kalevera/events{/privacy}","received_events_url":"https://api.github.com/users/Kalevera/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-30T22:59:56Z","updated_at":"2015-08-01T14:44:59Z","closed_at":null,"body":"The issue i'm having is, mongoose appears to attempt a write process to the MongoDB but fails. If I previously drop the collection in MongoDB I can see the collection being created but it doesn't show the document that i'm attempting to write to the DB. it's either an issue with how the mongoose schema is written, or a configuration issue with mongoDB i suspect the former but am unsure. \r\n\r\nthe mongoose schema i'm using is this \r\n````\r\nvar mongoose = require('mongoose');\r\nvar Schema = mongoose.Schema;\r\nvar dishesSchema = new Schema({dish:{\r\n\tuser_name: {type: String, default: 'Tree of life'},\r\n\tlocation: {type:String},\r\n\tgeo:{type:Schema.Types.Mixed,\r\n\t\tgtype: {type:String, default: \"Point\"}, \r\n\t\tcoordinates: {type:[Number],index:'2dsphere'}\r\n\t},\r\n\ttitle: {type: String, match: /[a-z]/},\r\n\tingdts: {type:String},\r\n\tcost:{type: Number, index: true}\r\n\t//image: {\r\n    //\tmime:  {type:String},\r\n    //\tbin: Buffer,\r\n    //\t}\r\n\r\n}});\r\n\r\nvar Dish = mongoose.model('Dish', dishesSchema)\r\n\r\nmodule.exports={Dish:Dish};\r\n````\r\nI then apply my JSON that's been paresed by body parser in express and assign the corresponding values from req.body.title, etc... to the schema and then use mongoose to create the document in the collection. for some reason ever since I added the sub-document geo to the schema it wont write, any thoughts? "},"comment":{"url":"https://api.github.com/repos/nodeschool/austin/issues/comments/126922674","html_url":"https://github.com/nodeschool/austin/issues/9#issuecomment-126922674","issue_url":"https://api.github.com/repos/nodeschool/austin/issues/9","id":126922674,"user":{"login":"evanlucas","id":677994,"avatar_url":"https://avatars.githubusercontent.com/u/677994?v=3","gravatar_id":"","url":"https://api.github.com/users/evanlucas","html_url":"https://github.com/evanlucas","followers_url":"https://api.github.com/users/evanlucas/followers","following_url":"https://api.github.com/users/evanlucas/following{/other_user}","gists_url":"https://api.github.com/users/evanlucas/gists{/gist_id}","starred_url":"https://api.github.com/users/evanlucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanlucas/subscriptions","organizations_url":"https://api.github.com/users/evanlucas/orgs","repos_url":"https://api.github.com/users/evanlucas/repos","events_url":"https://api.github.com/users/evanlucas/events{/privacy}","received_events_url":"https://api.github.com/users/evanlucas/received_events","type":"User","site_admin":false},"created_at":"2015-08-01T14:44:59Z","updated_at":"2015-08-01T14:44:59Z","body":"is the `geo` property supposed to be an object? If so, you do not need to specify the type for it. If coordinates should be an array, the square brackets should be outside the object vs the type like `[{ type: Number, index: '2dsphere' }]`\r\n\r\nSo, the whole object would like like:\r\n\r\n```\r\ngeo:{\r\n  gtype: { type:String, default: \"Point\" }, \r\n  coordinates: [{ type: Number, index:'2dsphere' }]\r\n}\r\n```"}}