I'm not sure whether the auto generated id (object_id) of mongodb is unique across all the document or not. I've a dilemma about referencing.
Says I have a system which multiple users can create their own products and categories. So I will have product collection and category collection.
To get a category of a product, should I get the category by using user id and product id or product id alone is enough? since I will first get the product id using user id before I can find the category of that particular product.