Specifically, I will have two collections. The two collections are two databases in MongoDB of HTTP header scrapes two months apart. Let's call them todayScrape and twoMonthFromNowScrape. Through these two collections, I want to compare their header objects, so, server, x-aspnet-version, and x-powered-by and see if there has been any upgrades within these numbers, E.G. IIS/7.5 upgraded to IIS/8.0 (in the future).

I do not have any code to display, because I don't know how to implement this system at all. I have no idea where to begin. I want to first compare the two URLs, then when the program identified that both URLs exist, it would then do a specific comparison of the three header objects. It could then report whenever these attributes are changed by scanning them in order and set off some event like console.log("There has been a change") when the strings are not identical.

Can anyone give me any suggestions on where to begin? I have been stuck on this issue a couple days and being stuck has been disheartening. I would really like to begin implementing it, but I need some assistance.

Yessir. I did not phrase my question properly last time, therefore I was not able to properly express what I was trying to propose.
–
theGreenCabbageMar 26 '13 at 20:43

Unfortunately the question is too broad, and SO community mostly deal with actual code-challenges rather than with abstract and consultancy-nature questions. Although I would recommend you to put everything in one collection and then use aggregations to group by url key and sort data inside, and get nice results of out good aggregate query so you can then analyse data and make your next logical decisions.
–
mokaMar 19 '14 at 10:38

This is a very old question with an accepted answer...........
–
theGreenCabbageMar 19 '14 at 13:26

Wow. Thanks for your code. I wanted to thank you first before I try. Could I keep you updated with my progress? I already have my MongoDB setup, and I have the two collections of headers. The part in which I am stuck in was the use of logic to find the attributes that are not identical.
–
theGreenCabbageMar 26 '13 at 19:43

Are there any differences I need to make to your code if I have two collections already, and one is called scrape and the other is called scrapeFuture? The code I have currently uses var dburl = 'localhost/scraperapp'; var collections = ['scrapeFuture']; var db = require('mongojs').connect(dburl, collections);
–
theGreenCabbageMar 26 '13 at 19:47

1

@theGreenCabbage - Yeah if you already have access to the collections, then you can just replace today_scrape and 2month_scrape with your variables and only include the code starting from today_scrape.find({url: .... and ending with the appropriate });
–
AustMar 26 '13 at 19:50

Can you explain to me what today_docs and 2month_doc does? It does not seem like it's parallel to the rest of the code. Does it mean today_scrape and 2month_scrape? Thank you.
–
theGreenCabbageMar 26 '13 at 19:57