Chapter 4: Lab 2, Comparison Operators

Hi all, excuse my english :slight_smile:

We have to find the number of people born between two years in sample_training.trips but this collection has no such data, it contains trip information.
Should this be done with another collection or i am missing somethingā€¦?

Thanks in advanceā€¦

Hi,

If we use sample_training and then db.trips.findOne() and get:

{
 ...
  usertype: 'Subscriber',
  'birth year': 1988,
  gender: 1,
  ...
}

The exercise asks for

  • Number of ppl born after 1998
  • Number of ppl born in 1998
  • Substract those values.

You can use ā€œbirth yearā€, count() and the learnt operators to solve it. Any issue come back to the forum :slight_smile:

Oh, i got it now, thank you so much
Maybe the collection name ā€˜Tripā€™ confused me a bit, but now i know how to do itā€¦

Thanks :slight_smile: and sorry to bother youā€¦

1 Like

No worries, the forum is here for us to ask and help each other.

Good luck Jorge!