Các collection users, theaters, sessions (dữ liệu mẫu sample_mflix) đã được nạp sẵn vào database hiện tại.
db.getCollectionInfos() (không truyền bộ lọc theo tên), lưu vào biến infos.infos, sắp xếp tăng dần.infos (bằng JavaScript, ví dụ find/filter) để tìm riêng phần tử có name: "users", lưu vào biến usersInfo, rồi in các trường name, type, options của phần tử đó.Lưu ý: không in toàn bộ phần tử (trường info.uuid là mã ngẫu nhiên, mỗi lần chạy một khác). Chương trình chỉ được in đúng 4 dòng như mô tả ở phần Output.
Collection users, theaters, sessions (dữ liệu mẫu sample_mflix) đã được nạp sẵn. Không có dữ liệu nhập.
In đúng 4 dòng:
[ 'a', 'b' ]).name: <name>type: <type>options: <options> — options in bằng JSON.stringify(...).Ví dụ định dạng (giá trị chỉ minh hoạ):
[ 'a', 'b' ]
name: a
type: collection
options: {}
Ví dụ:
Đầu vào:
sample_mflix.users
sample_mflix.theaters
sample_mflix.sessions
Đầu ra:
[ 'sessions', 'theaters', 'users' ]
name: users
type: collection
options: {}Đang tải editor...