Room schema
var Room = new Schema({
title: String,
author: String,
body: String,
owners: [ { type: ObjectId, ref: "User", index: true } ]
})
Room.find({ owners: user })
first question: why can the query here be written this way? How to check the data in the database when it is written like this?
second question: what is the difference between the user.id effect and the one written above when I change it to the same effect?
Last question: is ObjectId automatically generated by MongoDB?