These are chat archives for Automattic/mongoose

Jun 2016
Yogesh Patel
Jun 24 2016 04:46
@ycpatel813 i use angular in my frontend, with angular it's easy to do with default filter like {{ yourdate | date:'YYYY-MM-DD'}} @ishikawayoshi thanks for suggestion but i want to do it from backend
Jun 24 2016 05:48
hey..hw to insert a json file into db using mongoose???
Mohamed Nasrullah
Jun 24 2016 06:06
already mongoose db is json based only. make it clear what u want.
Jun 24 2016 06:07
i have file like i want to push this file to my db
Mohamed Nasrullah
Jun 24 2016 06:08
create a schema containing that fields and map that values to this field.
Chris Blokland
Jun 24 2016 06:59
When I create a new document instance I see that the document itself is a mongoose object (read: not plain js object) but I have a an array of sub documents (establishments are sub docs under a store for example) and I was wondering how I could create an instance of a sub document when hydrating values..

I expected that something was possible like this:

const store = new Store();
const establishment = new store.establishments.schema();

but the getter for establishments in this example returns a plain js object...

which obviously doesn't contain the establishment schema
Alex Shpak
Jun 24 2016 07:49
@ycpatel813 maybe helps you it have methods to easy date format
@bunnypolisetty_twitter you can find all this solutions in documentation