This question has already been answered:
C server data goes and there is an id with a data type of ObjectId. On the client, it comes in this form:
Object { timestamp: 1476891401, machine: 13949887, p id: 10700, increment: 3401974, creationTime: "2016-10-19T15:36:41Z" } If you use .toString (), you get "[object Object]".
Action:
public JsonResult GetPictures(int page = 0) { int count = 12; IMongoCollection<Photo> collection = DBConnection.GetInstance().GetCollection<Photo>("Photos"); List<Photo> pictures = collection.Find(new BsonDocument()).Skip(page * count).ToList().Take(count).ToList(); return Json(pictures); } Model Photo:
public class Photo { public ObjectId Id { get; set; } public string Name { get; set; } public string Path { get; set; } public string[] Categories { get; set; } public DateTime DateTime { get; set; } }