Truy vấn các phim có mảng genres tồn tại và số phần tử > 2 (tức là có từ 3 thể loại trở lên).
Yêu cầu:
genres — không lấy các phim này.title và genres, không hiển thị _id.title tăng dần, nếu trùng thì theo _id tăng dần.Collection movies (dữ liệu mẫu sample_mflix.movies) đã được nạp sẵn.
Danh sách 10 document theo định dạng mongosh, mỗi document chỉ gồm genres và title (thứ tự trường theo thứ tự trong document gốc, không có _id). Ví dụ định dạng:
[
{ genres: [ 'Comedy', 'Crime', 'Drama' ], title: '$' },
...
]
Ví dụ:
Đầu vào:
sample_mflix.movies
Đầu ra:
[
{
genres: [ 'Documentary', 'Action', 'Drama' ],
title: '#chicagoGirl: The Social Network Takes on a Dictator'
},
{ genres: [ 'Comedy', 'Crime', 'Drama' ], title: '$' },
{ genres: [ 'Action', 'Drama', 'Thriller' ], title: "'71" },
{
genres: [ 'Adventure', 'Comedy', 'Drama' ],
title: "'Pimpernel' Smith"
},
{
genres: [ 'Comedy', 'Drama', 'Romance' ],
title: '(500) Days of Summer'
},
{ genres: [ 'Comedy', 'Drama', 'Music' ], title: '(Untitled)' },
{
genres: [ 'Comedy', 'Drama', 'Family' ],
title: '*batteries not included'
},
{ genres: [ 'Comedy', 'Drama', 'Sport' ], title: '...All the Marbles' },
{
genres: [ 'Crime', 'Drama', 'Thriller' ],
title: '...And Justice for All.'
},
{
genres: [ 'Animation', 'Action', 'Sci-Fi' ],
title: '009 Re: Cyborg'
}
]Đang tải editor...