Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
How to put data (multiple lines and columns) into one collection?

I'm building a database, I'm trying to put all the rows and columns in one collection named(Task) to make it easier to search for them later, but it doesn't work.

when I write {Sector: String} Next to {Name: String} It doesn't work, He forces me to make another collection. How can solve this problem?

<!--ejs file:-->
<!--add a task-->    
<form action="/create" method="POST">
    <input type="text" name="Name">
    <button type="submit" class="btn btn-link">Link</button>
</form><br>


<!--JS file:-->
app.set("view engine", "ejs");
app.use(express.urlencoded({extended: true}));
mongoose.connect('mongodb://localhost:27017/Investors');

const schema = new mongoose.Schema({Name: String});
const Task = mongoose.model("Task", schema);

//insert
app.post("/create", (req, res) => {
const firstTask = new Task({Name: req.body.Name});
firstTask.save().then(() => res.redirect("/"));    
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!