These are chat archives for Automattic/mongoose

3rd
Sep 2018
Arun Kumar
@arunkumar413
Sep 03 2018 05:24
Does mongoose work with mongo db Atlas
Kev
@lineus
Sep 03 2018 10:55
@arunkumar413 yes it does :)
Dimitar Danailov
@dimitardanailov
Sep 03 2018 14:53

Hello Guys,

Before few days ago I wrote an article about VSCode and how VSCode could be your Swiss Knife

I'd like to share my article with this gorgeous audience: https://medium.com/@d_danailov/productivity-with-vs-code-tips-and-tricks-51ae11e2e087

Zachary Gibson
@zachgibson
Sep 03 2018 15:09
@lineus Thanks for the help! I’m using a different syntax than that and got an answer on S.O. in case anyone is interested.
Warehouse.aggregate([
  {
    $project: {
      zip: {
        $substr: [
          "$address",
          {
            $subtract: [{ $strLenCP: "$address" }, 5]
          },
          5
        ]
      }
    }
  }
])
Kev
@lineus
Sep 03 2018 16:04
@zachgibson that's cool. I didn't realize you wanted to do it on the server side. I'm glad you found the answer you were looking for.
Zachary Gibson
@zachgibson
Sep 03 2018 16:11
@lineus appreciate the help. I’m a front-end guy delving into backend stuff, thus the confusion. :p
Kev
@lineus
Sep 03 2018 16:15
next time feel free to tell me if I'm going in the wrong direction :smile: I'm just learning this stuff too, I would have had fun sorting out the pipeline for that aggregation!