const Experience = require('./models/Experience');
const Graduation = require('./models/Graduation');
const Project = require('./models/Project');
const User = require('./models/User');
async function getAndShowSomeInformations({ username }) {
// USER DETAILS -----------------------------------------
const user = await User.findOne({
username,
});
console.log(user);
/* {
_id: '5a093631713c0900019b0000',
name: 'Thiago Souza',
username: 'thrsouza'
title: 'Full Stack Developer',
alias: ['ZeroDois', 'Rezim', 'Mizer'],
hobbies: ['Music', 'Games', 'Movies', 'Series'],
} */
// CURRENT JOB ------------------------------------------
const currentJob = await Experience.findOne({
userId: user._id,
endDate: null,
});
console.log(currentJob);
/* {
_id: '5b093631713c0900019b0001',
userId: '5a093631713c0900019b0000',
title: 'Full Stack Technical Leader',
companyName: 'Golfleet Tecnologia',
employmentType: 'Full-time',
location: 'Londrina, PR - Brazil',
startDate: '2020-01-16',
endDate: null,
} */
// GRADUATION -------------------------------------------
const graduation = await Graduation.findOne({
userId: user._id
});
console.log(graduation);
/* {
_id: '5c093631713c0900019b0002',
userId: '5a093631713c0900019b0000',
school: 'Campus Virtual Cruzeiro do Sul Educacional',
fieldOfStudy: 'Análise e Desenvolvimento de Sistemas',
startDate: '2018-01-01',
endDate: '2020-12-31',
} */
// OPEN SOURCE PROJECTS ---------------------------------
const projectsOpenSource = await Project.find({
userId: user._id,
openSource: true
});
console.log(projectsOpenSource);
/* [
{
_id: '5d093631713c0900019b0003',
userId: '5a093631713c0900019b0000',
name: 'neutronjs',
repository: 'https://github.com/neutronjs/neutron',
openSource: true,
},
{
_id: '5d093631713c0900019b0004',
userId: '5a093631713c0900019b0000',
name: 'cheesecakejs',
repository: 'https://github.com/thrsouza/cheesecake',
openSource: true,
},
] */
}
getAndShowSomeInformations({ username: 'thrsouza' });
thrsouza Goto Github PK
Name: Thiago Rodrigues Souza
Type: User
Bio: Tech Lead | Full Stack Developer @ Golfleet - Turning coffee into code!
Location: Londrina, PR - Brazil
Blog: https://thiagosouza.com