Mon locationsModel
fichier :
mongoose = require 'mongoose'
threeTaps = require '../modules/threeTaps'
Schema = mongoose.Schema
ObjectId = Schema.ObjectId
LocationSchema =
latitude: String
longitude: String
locationText: String
Location = new Schema LocationSchema
Location.methods.testFunc = (callback) ->
console.log 'in test'
mongoose.model('Location', Location);
Pour l'appeler, j'utilise :
myLocation.testFunc {locationText: locationText}, (err, results) ->
Mais je reçois une erreur :
TypeError: Object function model() {
Model.apply(this, arguments);
} has no method 'testFunc'