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

164
Views
generate series in mongodb

In postgres we use the below code when we need a time series data for a line chart


SELECT date_trunc('day', dd)::date
FROM generate_series
        ( '2004-04-01'::timestamp 
        , '2005-04-01'::timestamp
        , '1 day'::interval) dd
        LEFT JOIN school_attendence on dd = school_attendence.attendence_date

Is there a similar function in mongodb or mongoose library that will do the job for me?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use tool mgeneratejs :

//install mongo and down mongoinport

//install tool
$ npm install -g mgeneratejs

//generate 10000000 documents for mongodb
$ mgeneratejs '{"name": "$name", "age": "$age", "emails": {"$array": {"of": "$email", "number": 3}}}' -n 10000000 | mongoimport --uri mongodb://localhost:27017/test --collection user --mode insert
about 4 years ago · Juan Pablo Isaza Report
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!