I have a bunch of video records and I want to find out the video ids of this record.
I had try collect, pluck
and distinct
as well but it's tacking to much time for execute. so I want to use aggregate query. but I don't know how to write this query. If any one knows please help me out.
videos = Video.all
video_ids = videos.pluck(:id)
Thanks :)
Aucun commentaire:
Enregistrer un commentaire