products:
{ _id: 10, name: "Blue elephpant", category_ids: [ 4, 7 ] }
{ _id: 11, name: "Pink elephpant", category_ids: [ 4, 8 ] }
categories:
{ _id: 4, name: "toys" }
{ _id: 7, name: "everything blue"}
{ _id: 8, name: "everything pink"}
product = db.products.find( { _id: 11 } );
db.categories.find( { _id: { $in: product.category_ids } } );
db.products.find( { category_ids: 4 } );