Giter Club home page Giter Club logo

day36task36_be_mongodb_task_2_vidhya's Introduction

Zen Class DB using MongoDB

  1. Find all the topics and tasks which are thought in the month of October

db.createView( "octoberSession", "topics", [ { $lookup: { from: "tasks", localField: "topic_id", foreignField: "topic_id", as: "tasksDocs" } }, { $project: { _id: 0, topic_id:1, task_id:"$tasksDocs.task_id", Date:1, topic_name:1, task_name:"$tasksDocs.task_name" } }, { $unwind: "$task_id" }, { $unwind: "$task_name" } ] )

db.octoberSession.aggregate([{$match:{$expr:{$eq:[{$month:{$dateFromString:{dateString:"$Date", format:"%Y-%m-%d"}}},10]}}}])

  1. Find all the company drives which appeared between 15 oct-2020 and 31-oct-2020

db.company_drives.find({Date:{$gte:"2020-10-15",$lte:"2020-10-31"}})

  1. Find all the company drives and students who are appeared for the placement.

db.createView( "placement1", "company_drives", [ { $lookup: { from: "users", localField: "User_id", foreignField: "User_id", as: "userDocs" } }, { $project: { _id: 0, User_id: 1, User_name:"$userDocs.Name", drive_id: 1, Date: 1, drive_name:1,

    }

}, { $unwind:"$User_name" } ] )

db.placement1.find()

  1. Find the number of problems solved by the user in codekata

db.codekata.aggregate( [ { $group: { _id: "$User_id", totalProblemsSolved: { $sum: {$toInt:"$Problems_solved" }} } } ] )

  1. Find all the mentors with who has the mentee's count more than 15

db.mentors.find({ mentee_count: { $gt: 15 } }).pretty()

  1. Find the number of users who are absent and task is not submitted between 15 oct-2020 and 31-oct-2020

db.attendance.aggregate([ { $match:{ Date:{ $gte:"2020-10-15", $lte:"2020-10-31" }, Status:"Absent" } }, { $lookup:{ from :"tasks", localField:"User_id", foreignField:"User_id", as:"tasksDocs" } }, { $match:{ "tasksDocs.submitted":"false" } }, { $group:{ _id:null, count:{$sum:1} } } ])

day36task36_be_mongodb_task_2_vidhya's People

Contributors

vidhya0501 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.