A few days ago I was working on a task in which I’ve to write an endpoint to download a file from the server.
As usual, for every code we write in the team(at least for the backend side), we write the correct test cases. Until now, I had written test cases that checked the returned http code, the correct Content-Type, Content-Disposition and Content-Length headers and that’s all. This time, I want to check that I’m downloading the correct file (check the content I’m receiving).
First, I was thinking that it would be just check the “body” in the response…
Si una palabra se ha extendido en los últimos meses por todo el mundo, además de la tristemente conocida “COVID-19", es “teletrabajo” y esta, poco a poco se ha ido adueñando de portadas de periódicos y noticiarios, entradas en blogs, etc… .
Lo que debemos destacar es que para nada es algo nuevo, sólo en Estados Unidos desde 2005 hasta 2019 hubo un aumento de un 159% en esta tendencia (artículo en inglés). …
After working with Node.js for more than 5 years, I can say that its package module system is one of the keys to its large adoption in many companies. In my case, I used to take advantage of this feature.
In my team, we follow some rules to organize our code:
A few months ago the linux foundation published the expected Node.js certifications: OpenJS Node.js Application Developer and OpenJS Node.js Services Developer . Here you will find all the needed information about the certification requirements, topics, process and prices (you can get a 30% discount which is valid until May 31 2020). By now, when you get the voucher for the exam, you will get a free 2nd attempt.
By the time I first started to look for information about the exam I didn’t…
Hace ya unos meses, la Linux Foundation, presentó las esperadas certificaciones para Node.js: OpenJS Node.js Application Developer and OpenJS Node.js Services Developer. En estos enlaces podrás encontrar toda la información necesaria sobre los requisitos, temario, proceso para el examen y precios (hasta el 31 de Mayo de 2020, está disponible un descuento del 30%). Al menos por ahora, cuando obtienes el voucher para tu examen, obtienes también un segunda oportunidad en caso de no pasar el examen a la primera.
I have hear many different answers, thinks like: ES6, Promises, React,…
In the interviews I like to turn them in more a conversation than a questioning and like for other questions, I use to give mine about this one, here are the thinks I use to say:
Every time I talk with people about TDD, the main topic is the difficulty of doing it well. I use to say that it’s no so easy as some people say it is, but also, is not so hard either.
From my point of view, you need to have 3 things:
1- To have a clear and well defined functionality: someone have to define the behaviour you have to code. It includes defining how it should behave when it works fine and also when it fails in any way it can.
In a previous post we saw the importance of the
.lean() in your queries when you are using mongoose and you need to find out a big amount of data(and you don’t need any mongoose hook) to save time in your process.
Today we are going to see how to save time when you need to write that information into another mongodb collection.
Let’s see the code:
In this code we are making a find query, using
lean() and a
cursor to go through all the elements in our query.
We are “saving” the element in an array until we…
Recently I needed to perform some actions for big amounts of data stored in a mongodb collection. For the related project we are using nodes.js + mongodb(managed with mongoose). My first thought when starting this task to move data from one collection to another was to reuse the current mongoose schema we have been using to handle the data in our application.
For testing purposes I wanted to know how much time it would take to read the required data and iterate over it. …