Most of my Forms use an @DBLookup or two at one point or another. It's a great function for all sorts of stuff, with one big drawback — you have to have an associated view to lookup against.
How many times have you worked on an application - whether originally yours or not - and needed to do a lookup only to find there's no suitable view? As a conscientious developer you loathe the idea of adding yet another view. Even if you do find a view you can use you then worry it might change or go missing and kill the code you add. It's a tricky situation.
Imagine if there were another function we could use. Somewhere between @DBLookup and @GetDocField. Maybe called @FindDocument:
@FindDocument(Field; Value; ReturnField; Keywords)
So you could use it like this to find somebody's email address:
@FindDocument("username"; "jake howlett/rockall"; "email")
Maybe it would be better if it were called @FindDocuments and returned all matches. Maybe the parameters passed to it should allow text lists so we could match multiple fields?
Now, I know what you're going to say. Performance would suck. So, instead, we've got to add a view each time we want to get at the documents via another route. Surely there's as much of a performance hit there!? How many times have you seen a database with a myriad of views named like "(luThisByThat)" only to wonder whether they're all really needed.
Personally, I'd suffer the performance hit just so I could easily get to any document I wanted, without having to search for the best view to use or adding another one. How slow could it possibly be? It's only like a db.Search() call, which always seem quite fast to me.