Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rtanglao/999846 to your computer and use it in GitHub Desktop.

Select an option

Save rtanglao/999846 to your computer and use it in GitHub Desktop.
getNumberOfGetSatisfactionTopics w/"unified" between 2010 1 Aug to 2011 1 Jan

Answer: 107 topics created with the word "unified" from Aug 1, 2010 to Jan 1, 2011

> use gs
switched to db gs
> var  start = new Date(Date.UTC(2010,7,1));                                                                          
> var end = new Date(Date.UTC(2011,0,1));    
> db.topics.findOne({"created_at": {$gte: start, $lt:end},"$where":"this.fulltext.indexOf(\"unified\") != -1"},{"at_sfn":"1"});
{
"_id" : ObjectId("4d7b48cdcf3298130900024e"),
"at_sfn" : 
"http://getsatisfaction.com/mozilla_messaging/topics
/why_does_my_thunderbird_not_always_report_when_new_emails_come_in_now"
}
> db.topics.find({"created_at": {$gte: start, $lt: end},
"$where":"this.fulltext.indexOf(\"unified\") != -1"}).count();          
107
@rtanglao
Copy link
Author

see identical query for a later period from Jan 1, 2011 to May 27, 2011
https://gist.github.com/999859

@rtanglao
Copy link
Author

rtanglao commented Jun 5, 2011

with database fixed with 40000 instead of 23000 topics:
> db.topics.find({"created_at": {$gte: start, $lt:end},
... "$where":"this.fulltext.indexOf("unified") != -1"}).count();
123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment