Hi I am new to Mongo db I have class structure like this for storing smilies and smilies category. I have made a mongodef property in smilies class for referencing smilies category collection but enable to get smilies category name...
public class smilies {
public ObjectId _id { get; set; }
public MongoDBRef scat_name{ get; set; }
public string smil_url { get; set; }
public string smil_detail { get; set; }
}
public class smilies_category {
public ObjectId _id { get; set; }
public string scat_name { get; set; }
}
and I am using below code for getting the record and records are coming but only from one document
function void getSmilies(){
var refDocument = new BsonDocument {
{"$ref", "smil_scat_id"},
{"$id", "539ef7c2e46b621314956e3b"}
};
var query = Query.EQ("smilies_category", refDocument);
var result = db.GetCollection("smilies").Find(query)
}
Now What I want here is combine resultset like
"_id" : ObjectId("539f3ec1e46b62120023d364"),
"scat_name : "Bussines",
"smil_url" : "www.gmail.com",
"smil_detail" : "Ok fine",
How can we achieve this?
Is I am going right way?
Please let me the know the solution