These are chat archives for Automattic/mongoose

24th
Apr 2015
Roland N Sharp
@rolandnsharp
Apr 24 2015 00:04
The only backward breaking change related to eventEmitter is this: Automattic/mongoose#1351 : Document no longer inherits from EventEmitter. But my tests that rely on the eventEmitter seem to pass just fine.
Roland N Sharp
@rolandnsharp
Apr 24 2015 00:51
Found the issue #2552: 'Upgraded mongodb driver to 2.0.x.' I was using this to define my replicaSets: mongoose.connect('mongodb://localhost:27017,localhost:27018,localhost:27019'); Now I must specify the replicaSet option in the string.
Roland N Sharp
@rolandnsharp
Apr 24 2015 01:10
Sorry to fill up the chat like this but I can't delete: I'm still having trouble with my mongo URI. Mongoose connection error name=MongoError, message=no primary found in replicaset
mongoose.connect('mongodb://localhost:27017,localhost:27018,localhost:27019/db_name_test', {
    server: {
        read_secondary: true
    },
    replset: {
        rs_name: 'someReplicaSet'
    }
});
Joseph Thibeault
@jrthib
Apr 24 2015 01:21
Are you able to add static methods to a schema after running it through mongoose.model?
Joseph Thibeault
@jrthib
Apr 24 2015 01:30
Nvm you can’t, just tested it
haha
Roland N Sharp
@rolandnsharp
Apr 24 2015 07:06
Looks like my local replicaSets went down. All fixed :D
Valeri Karpov
@vkarpov15
Apr 24 2015 21:34
@francesconero one process queries for documents that match { a: 1 } and sees no docs, another process does the same query and sees no docs, immediately afterward the first process writes a doc and then the second process also writes a doc
Francesco Nero
@francesconero
Apr 24 2015 21:42
@vkarpov15 Yes, of course, thanks for the heads up. I'm now using the bulk API and it's so much faster! I had to give up on a lot of information about the updates though.
Sometimes I miss transactions
Valeri Karpov
@vkarpov15
Apr 24 2015 21:55
Sometimes transactions are necessary :) most of the time they're just extra cruft though IMO