-1

I am using node.js as a scripting language and I am also using nunjucks as the template engine. I have a weird situation going where some of the data that I retrieve from the MongoDB database is not being printed into document.

As you see hear these are the values that I want to print to the web page enter image description here

But when you look at the web page, only some of the data has been printed out and the other information is missing. enter image description here

I console.logged the data to prove that the values are in the database enter image description here

A weird thing is that if you write the whole object into the code, like so enter image description here

It will output all the data in one block. That includes the month, the year, and slug property that I am trying to output to the page. Yet, it only does that if I print out the whole object enter image description here

black_yurizan
  • 407
  • 2
  • 7
  • 19
  • Questions seeking debugging help (**"why isn't this code working?"**) must include the desired behavior, a *specific problem or error and the shortest code necessary* to reproduce it **in the question itself**. Questions without a **clear problem statement** are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example.](http://stackoverflow.com/help/mcve) – Neil Lunn Jun 21 '17 at 04:44
  • In brief. Get rid of the pictures and only include the relevant data and code **"as text"**. An amazing medium that somehow I think is actually used to write your code. – Neil Lunn Jun 21 '17 at 04:45

1 Answers1

0

I found out what was the problem. In my mongoose schema, I did not have the properties listed like slug, month, or date. So when I tried to retrieve data from those properties it did not output them. So If you are having similar problems make sure the properties are declared in your mongoose schema

black_yurizan
  • 407
  • 2
  • 7
  • 19