These are chat archives for Automattic/mongoose

18th
Jul 2016
Dylan Piercey
@DylanPiercey
Jul 18 2016 02:39

Is there a way in mongoose to do a 'select' query directly on a model?

var user = new User({ ... })
res.body = user.select('name email -_id')

This is a terrible example, and not what I am doing but does something like this exist?

Dylan Piercey
@DylanPiercey
Jul 18 2016 03:29
What I was trying to do was discussed here Automattic/mongoose#1020, just had to look harder :p.
Matt Huijsse
@mistamadd001
Jul 18 2016 03:35
you shouldnt be storing the password without hashing it first anyway so whats the issue with storing the hash in the JSON?
Dylan Piercey
@DylanPiercey
Jul 18 2016 04:17
That's why I said it's a terrible example and not what I am doing :smile:
korzio
@korzio
Jul 18 2016 10:55
I'm sure it was asked many times - why mongoose is not using a json-schema? At least it has a specification and a lot of implementations. Are the any plans to migrate to json-schema?
Chanaka De Silva
@chanakaDe
Jul 18 2016 17:03
Hey, have a question about grouping. There are incomes in my data. and i want to group them by month and get monthly income.. And if there are no income from a certain month, i want to get zero. How can I do this ????
I asked in stack too :( but no answer
brandonjfajardo
@brandonjfajardo
Jul 18 2016 22:18
mongoose or another DB for a e-commerce site?