Hello everyone. I am fairly new to this so here goes.
I have say a collection of “items”, and I have a collection of “users”. If i want userA to own a new copy of itemA, userA to own a itemB, userB to own a itemA.
userA item is unique to userA say by assigning a feild
ownerId: {
type: mongoose.Schema.Types.ObjectId,
ref: “User”,
default: null,
}
Do I create all the fields for item and make a new collection say “owned” and create the documents there ? or can I use a $lookup or populate for the “owned” item ? Or am I thinking incorrectly? Any help suggestions would be great.