eval()
method, as I wanted to ensure I cater for all returned types within mongometer.
Seemed simple enough, I thought.
I went straight to DB.java and saw that we're calling
command()
and extracting an object keyed by retval
. Interesting, to see retval
, a potentially project-wide constant, defined as a String
rather than as an Enum
. Anyhoo, this isn't a critique of the driver code, so I'll park that for now, I just wanted to find what could possibly be returned by eval()
.
An easy way to do this is to
fetch
the branch and search it locally. But I wouldn't really want to do this for every single project that I ever want to cruise? No way, Pedro! So, let's use the online GitHub Search.
A good place to start:
https://github.com/search
Advanced Search :
retval repo:mongodb/mongo-java-driver
Search for:
Code
Search Language:
Java
That all seems sane enough. Right?
Wow! That was unexpected. I haven't been returned the results limited to the filetype of
Java
, I've been returned a list of files that contain the term java
. Let's have a quick look at the querystring.
It seems to be searching for
Java
, so let's swap out Java
for retval
, our actual search term.
Now you get the results for
retval
. We have an unknown number of matches for retval
from within the Java driver code base. But is seems we have been returned results for every version of the file that the search term is found in. Let's park that and come back to it later.
You get the same results when you completely remove the
language
from the querystring. Let's remove it and leave it off as it reverts back to using Java
as the search term.
It might not seem like it, but we're getting somewhere. Notice there is a
repo
parameter on the querystring. Let's pull the repo:mongodb/mongo-java-driver
out of the q
term and stick it in the repo
parameter.
Now on the search form we have a separate input field where you can specify the
repo
.
So, let's try limiting it to a single version of each file in the repo. Hmmm, not sure how to do this. Anyone got any ideas? I must be missing something as I'd have thought that search is fundamental to any website these days. Anything I try seems to result in with the same error message.
Invalid search query. Try quoting it.
All I want to do is search files for a given string, without having to fetch the entire repo.
I'd look through the github.com repo to investigate further, but I don't seem to be able to find github on github.
To be continued...