Thursday, 5 September 2013

Calculate a counter in MongoDB

Calculate a counter in MongoDB

I need to create a counter to track "likes" / "hearts" over a multimedia
item displayed in my webpage most likely an image or a video, this
functionality is pretty much standard and a very similar case to what
facebook / Instagram / Dribble does.
I'd like some advice of how can I implement such kind of counter and I
proceed with this implementation bearing in mind the best performance of
it.
My entity model so far is the following:
public class Portfolio:Entity
{
public int UserId { get; set; }
public string Url { get; set; }
public string Thumbnail { get; set; }
public string FullSizeImage { get; set; }
public string Description { get; set; }
public MediaType MediaType { get; set; }
}
please take a look to a dribbble screenshot for reference
I'm using C# and MongoDB Driver / MongoRepository

No comments:

Post a Comment