These are chat archives for Automattic/mongoose

17th
Apr 2016
LeonineKing1199
@LeonineKing1199
Apr 17 2016 02:19 UTC
@vkarpov15 Lol I'm not hating on JS' performance. I don't think it's slow. But I think it's ridiculous how much people seem to care about how performant their JS is. Web development is a far different realm than "actual" high-performance computing. Web fast is, "your user doesn't really notice any lag" which means you that anything less than 1 second is "good enough"
Pier-Luc Gagnon
@Nepoxx
Apr 17 2016 06:08 UTC
Where the hell is that coming from
When you have 10000 concurrent users, you care about how performant it is.
饥人谷
@jirengu
Apr 17 2016 14:18 UTC
hello
LeonineKing1199
@LeonineKing1199
Apr 17 2016 16:36 UTC

When you have 10000 concurrent users, you care about how performant it is.

Okay, I'll let you know when I have 10,000 concurrent users...

Out of curiosity, who even sees that much traffic? I'm not Wells Fargo or Facebook, man.
Ítalo Maio
@italomaio
Apr 17 2016 19:10 UTC
please someone can help mee
im getting 'cannot read property X of undefined' while i try to save record to DB
Vlado Tesanovic
@vladotesanovic
Apr 17 2016 19:12 UTC
@italomaio can you paste portion of your code here?
Ítalo Maio
@italomaio
Apr 17 2016 19:13 UTC
yes
```newUser.name = req.body.name;
newUser.email = req.body.email;
newUser.password = req.body.password;
        console.log(newUser);

        try { 

            newUser.save(function(err){

                if (err) { 
                    res.json({ success: false, msg: err.message });
                    return;
                }

                return res.json({ success: true, msg: 'usuari criado'});
            });

        } catch (e) {

            console.log(e);
        }
Vlado Tesanovic
@vladotesanovic
Apr 17 2016 19:15 UTC
and you are sure that you have username in req.body.name ?
Ítalo Maio
@italomaio
Apr 17 2016 19:18 UTC
yes i have
when i print newUser object to console i could read those property normally
Vlado Tesanovic
@vladotesanovic
Apr 17 2016 19:19 UTC
which line throw this error ? 'cannot read property X of undefined'
try catch block does not have sense with asynchronous code
Ítalo Maio
@italomaio
Apr 17 2016 19:20 UTC
the first line of save method
i will remove try/catch
so...
Vlado Tesanovic
@vladotesanovic
Apr 17 2016 19:25 UTC
and even before everything you have : var newUser = new userModel();
Ítalo Maio
@italomaio
Apr 17 2016 19:30 UTC
yes
Vlado Tesanovic
@vladotesanovic
Apr 17 2016 19:33 UTC
i can't help, seems fine
Ean McLaughlin
@computertechie
Apr 17 2016 21:25 UTC
Quick way to add a TTL index to the fields (createdAt, updatedAt) generated by the timestamps option?
or should I use schema.path('createdAt').expires('1d') to set the index on them?