Closed yuna9 closed 10 years ago
That's a good idea, I'm not sure a simple counter field would work for something like a usage frequency graph. I'm thinking something like this (the hits array):
{
"_id": ObjectId(),
"factoid": "mysqltuner",
"content": "https://raw.github.com/major/MySQLTuner-perl/master/mysqltuner.pl",
"owner": "kamal_",
"channel": "",
"createdAt": ISODate("2013-09-24T17:40:36.177Z"),
"locked": false,
"forgotten": false,
"hits": [
ISODate("2013-09-24T17:40:36.177Z"),
ISODate("2013-09-25T17:40:36.177Z")
]
"__v": 0
}
How does that sound?
Sounds good and looks nice to me. What is __v?
Mongoose (the MongoDB ORM that Modubot uses) adds that: http://mongoosejs.com/docs/guide.html#versionKey
Not sure how searchable an array of dates would be, though. I'll have to test it.
Done: d5570a4b4d07c58a0357ee8919f5be57829d4393
It would be very cool to see a counter for how many times a factoid has been used. It can then be combined with the age of the factoid to see the frequency of use over a day, for example.