Which of the following are valid ways to define a Mongoose schema with timestamps?
4 phương ánCó giải thíchTrung bình
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Để định nghĩa một schema Mongoose với timestamps, có hai cách hợp lệ. Trước hết, bạn có thể sử dụng phương thức constructor với tham số thứ hai là một đối tượng chứa tùy chọn. Ví dụ:
new Schema({
fieldName: String
}, { timestamps: true }). Thứ hai, bạn có thể sử dụng phương thức set() để thêm tùy chọn timestamps vào schema đã tồn tại. Ví dụ:
new Schema({
fieldName: String
}).set('timestamps', true).
Cùng chương 5
Which of the following are true about the match option in the populate() method? (Choose 2 answers)Có lời giảiCâu hỏiWhich of the following are valid options for the populate() method in Mongoose? (Choose 2 answers)Có lời giảiCâu hỏiWhat are not use cases for Mongoose in Node.js?Có lời giảiCâu hỏiCả 34 câu của chủ đề34 câu