These are chat archives for Automattic/mongoose

1st
Nov 2016
Listu
@Listu
Nov 01 2016 08:34
Hi there, is it possible to find multiple documents, loop on those docs to change something then save all at once or would I save one by one in the loop ?
Phu Pham
@anphu7492
Nov 01 2016 09:19
I’m not sure exactly what you need, but mongodb update method provides multi in options object (https://docs.mongodb.com/v3.2/reference/method/db.collection.update/)
Justin Headley
@JKHeadley
Nov 01 2016 09:51

hey guys, I'm working on a RESTful API generator using hapi and mongoose. If you're interested please check it out. Any feedback is greatly appreciated:

https://github.com/JKHeadley/rest-hapi

Eldar
@Eldar-X
Nov 01 2016 19:10
Hey guys what is common pattern for multilingual content of db
const post ={
  createdAt: "xx.xx.xxxx",
  translation: {
    en: { title:"My Post", content: "My Content" },
    es: { title:"My Post", content: "My Content" },
    ru: { title:"My Post", content: "My Content" }
  }
}

// OR
const post = {
  title:"My Post", 
  content: "My Content", 
  reatedAt: "xx.xx.xxxx",
  language: "en"
}
const post = {
  title:"My Post", 
  content: "My Content", 
  reatedAt: "xx.xx.xxxx",
  language: "es"
}
const post = {
  title:"My Post", 
  content: "My Content", 
  reatedAt: "xx.xx.xxxx",
  language: "ru"
}

// OR ANYTHING ELSE ?