These are chat archives for Automattic/mongoose

8th
Sep 2015
Pankaj Bhanu
@pankajbhanu
Sep 08 2015 07:40
i am trying to create a schema where I have to store multiple addresses and the associated geolocation for a person. I this schema correct
var customerSchema = new schema({
address: [{type: String, required: true, location : { type: [Number], index: '2d'}}]
})
Valeri Karpov
@vkarpov15
Sep 08 2015 15:33
@pankajbhanu nope, mongoose will interpret the schema you've written as "address is an array of strings". you're going to want "type: { type: String }"
@bmonty mongoose.createConnection(). Or just create the connection once.
@EricMcRay just another reason for you to upgrade :)