These are chat archives for Automattic/mongoose

19th
Oct 2015
Chris Paradeise
@cparadeise
Oct 19 2015 16:24
Greetings, I am working on password protection using node's crypto. My backend is MongoDB, using Mongoose on top of that. I have a server.controller populating RESTful methods. My exports.create() method initially creates a new document from SettingsSchema(req.body). Then, the method performs a findOneAndRemove, then a save. I am trying to modify my model so that there is a pre hook to encrypt the password if it has been modified. However, settings.isModified('password') is false when I reach the model. Please let me know what I'm doing wrong. Thanks :smile:
Chris Paradeise
@cparadeise
Oct 19 2015 16:30
I have a feeling that manually performing a findOneAndRemove is over complicating things. I was given this model, did not create it myself. The idea is, I believe, to keep one document in the collection for the 'settings' of our application.
Robby O'Connor
@robbyoconnor
Oct 19 2015 19:23
Hey I am running Mongo 3.0.6 and trying to connect via mongoose 3.8.12, I can authenticate via the mongo REPL but can't via mongoose
searching the web has not yielded any solution
mongoose.connect fails -- It even fails in the node REPL
Robby O'Connor
@robbyoconnor
Oct 19 2015 22:21
Nevermind -- fixed itself