I am newbie to mongodb. I need to link two collections something like in relationaldb one using primary key and foreign key concept.
I know mongodb doesnot support joins.
comments
{ uid:12345, pid:444, comment="blah" }
{ uid:12345, pid:888, comment="asdf" }
{ uid:99999, pid:444, comment="qwer" }
users
{ uid:12345, name:"john" }
{ uid:99999, name:"mia" }
in comments collections, uid --> primary key, in users, uid--> foreign key.
how to address this relationship in mongodb while inserting the collections in it? how to reference it?
could you send me the mongodb command for it?