You would like to know how many different categories you have. Which query will best get the job done?

  •  db.vehicle.distinct(“category”)
  •  db.vehicle.unique(“category”)
  •  db.vehicle.distinct(“category”).count()
  •  db.vehicle.distinct(“category”).length

Leave a Reply

Your email address will not be published. Required fields are marked *