Greetings everyone, this may seem like a very dumb question, but I couldn't find an answer in google.

Let's say I have a mongo entity called Person, and that person has a name and an age.

Let's say that, in a certain view of my project, I create a var person, in which I collect the data to create a new person document to save in the person collection in mongodb.

Here's my question, how do I turn this javascript variable called person into an object that I can save into the Person collection in mongodb??

Thanks in advance.