Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
135 views
in Technique[技术] by (71.8m points)

node.js - Group Results per Month using Mongo

I'm still trying to figured out to achieve this using Mongo. Hope anyone here can teach me and help me with my problem.

Here's my schema

    const User = {
    table: 'User',
    schema: {
        _id: {
            name : 'Id',
            type: db.keyType(),
            required: true
        },
        email: {
            name: 'Email',
            type: String,
            required: true,
            unique: true
        },
          }
}

desired results "19-12" is 19 = 2019 year and month 12 = December

    {
  "19-12": "5",
  "20-1": "22",
  "20-2": "20",
  "20-3": "4",
}
question from:https://stackoverflow.com/questions/65912554/group-results-per-month-using-mongo

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...