Sometimes we want to simply check that the result set of a query is not empty, thus it will be handy to add an Exists() method to the Query struct.
The can be implemented by simply check whether the document returned by FindAny() is not equal to nil.
Sometimes we want to simply check that the result set of a query is not empty, thus it will be handy to add an Exists() method to the Query struct. The can be implemented by simply check whether the document returned by
FindAny()
is not equal to nil.